Skip to content

Several small fixes for importing alternate names #7756

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

Merged

Conversation

jrose-apple
Copy link
Contributor

@jrose-apple jrose-apple commented Feb 25, 2017

More work in the vein of #6720. These are just small commits; there are still several big pieces:

  • Class and protocol members
  • Enum elements (tricky because of the case stripping)

I suggest reviewing commit-by-commit. These could have been separate PRs but they're all tiny.

This shouldn't have any effect since we've never customized how
parameter names are imported (body names, not argument labels), but it
removes special cases.
This doesn't actually have any effect yet, but if we start importing
both Swift 3 and Swift 4 versions of protocol requirements and the
non-active one is unavailable, we might mistakenly mark the protocol
un-implementable even when the requirements that are needed are all
there. (Hopefully we would never make a protocol /less/ available in a
newer release, of course.) The test case is designed to catch that.
When a C declaration is marked unavailable with a replacement, we look
for the replacement to see how it would be imported into Swift. Make
sure we do that with respect to the active language version.
Unlike values, we can't import multiple copies of types under
different names and get good results. Instead, we make a typealias
that points back to the original type. Make sure this typealias is
flagged with whatever version is appropriate, rather than always using
"Swift 2".
The compiler itself no longer uses this API but the debugger does,
in order to pretty-print option sets.

The normal way to test this would be to add an LLDB-side test that
uses a framework with versioned API notes. Unfortunately I can't
think of a straightforward way to test it Swift-side.
@jrose-apple jrose-apple requested a review from milseman February 25, 2017 00:15
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - ee0dd49
Test requested by - @jrose-apple

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test macOS

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look great, @jrose-apple , thank you!

@jrose-apple jrose-apple merged commit 67d2224 into swiftlang:master Feb 27, 2017
@jrose-apple jrose-apple deleted the small-multi-name-import-fixes branch February 27, 2017 22:01
@milseman
Copy link
Member

Late to the party, but +1 from me

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.

4 participants