Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ClangImporter] Don't crash on versioned import-as-member stubs. #8269

Conversation

jrose-apple
Copy link
Contributor

If a top-level declaration is imported as a member in Swift 4 but not in Swift 3, it would still show up in the lookup table for the containing type in Swift 3 mode. We would import it, and then try to add the top-level declaration to the containing type.

I'm about to redo this anyway so that the versioned stub will show up (the one for the Swift 4 name) but this is the narrow fix that avoids the assertion failure we were seeing.

rdar://problem/31161489

If a top-level declaration is imported as a member in Swift 4 but not
in Swift 3, it would still show up in the lookup table for the
containing type in Swift 3 mode. We would import it, and then try to
add the top-level declaration to the containing type.

I'm about to redo this anyway so that the versioned stub will show up
(the one for the Swift 4 name) but this is the narrow fix that avoids
the assertion failure we were seeing.

rdar://problem/31161489
@jrose-apple jrose-apple requested a review from milseman March 22, 2017 17:17
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple jrose-apple merged commit 0328139 into swiftlang:master Mar 22, 2017
@jrose-apple jrose-apple deleted the import-as-member-except-sometimes-not branch March 22, 2017 20:48
dabrahams pushed a commit that referenced this pull request Mar 22, 2017
If a top-level declaration is imported as a member in Swift 4 but not
in Swift 3, it would still show up in the lookup table for the
containing type in Swift 3 mode. We would import it, and then try to
add the top-level declaration to the containing type.

I'm about to redo this anyway so that the versioned stub will show up
(the one for the Swift 4 name) but this is the narrow fix that avoids
the assertion failure we were seeing.

rdar://problem/31161489
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant