-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[FixCode] Add diagnosis/fixit to help users deal with BooleanType's removal #4392
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
Conversation
…emoval. Due to migration reasons, types used to conform to BooleanType, which must contain a member var 'boolValue', now does not convert to Bool. This patch adds a specific diagnosis/fixit to explicitly invoke 'boolValue' to please the context types.
@swift-ci test macOS |
Build failed |
LGTM. |
Do you think we can also handle this case as well:
This gives |
@swift-ci Please smoke test |
@akyrtzi Did we see this case in actual codebase? |
// tries to add a specific diagnosis/fixit to explicitly invoke 'boolValue'. | ||
if (toType->isBool()) { | ||
auto LookupResult = CS->TC.lookupMember(CS->DC, fromType, | ||
DeclName(CS->DC->getASTContext().getIdentifier("boolValue"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CS->TC.Context
gets there a little faster.
This is rdar://problem/27894712, BTW, if not other Radars as well. |
@swift-ci Please smoke test |
@jrose-apple Comments addressed! |
@swift-ci Please smoke test |
@swift-ci Please test OS X platform |
@swift-ci test macOS |
Resolved bug number: (SR-)
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
A smoke test on macOS does the following:
device standard libraries are not built.
version of these tests are not run.
A smoke test on Linux does the following:
tests are not run.
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.