-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SILGen] Emit unreachable code diagnostic for single expression closures with implicit returns too #33604
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ures with implicit returns too
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please smoke test macOS |
Ping. @slavapestov @jckarter can you review? thanks! |
Ping. |
1 similar comment
Ping. |
jckarter
approved these changes
Sep 21, 2020
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.
Looks reasonable to me.
@swift-ci please smoke test |
ainu-bot
pushed a commit
to google/swift
that referenced
this pull request
Sep 21, 2020
* 'master' of github.com:apple/swift: [SILGen] Emit unreachable code diagnostic for single expression closures with implicit returns too (swiftlang#33604) Resolve ASTScope Issues [NFC] Only Register Primaries As Dependency Sources Drop Legacy Tests Remove DependencyRecorder::Mode Remove appendHolderOfCascadingMembers Remove LegacyCascadingDependencies Remove Cascading Computations from ASTScope Remove unnecessary dependency sources Remove Reference::cascades Remove DependencyScope Remove evaluator::getScopeForAccessLevel Remove DeclContext::isCascadingContextForLookup Remove NLOptions::NL_Known* Remove NameLookupFlags::KnownPrivate Remove UnqualifiedLookupFlags::KnownPrivate Remove TypeResolutionFlags::KnownNonCascadingDependency [leaks-checker] Add verbose flag to dump out raw output from runtime to help debug failures on bots.
ainu-bot
pushed a commit
to google/swift
that referenced
this pull request
Sep 21, 2020
* 'master' of github.com:apple/swift: [SILGen] Emit unreachable code diagnostic for single expression closures with implicit returns too (swiftlang#33604) Resolve ASTScope Issues [NFC] Only Register Primaries As Dependency Sources Drop Legacy Tests Remove DependencyRecorder::Mode Remove appendHolderOfCascadingMembers Remove LegacyCascadingDependencies Remove Cascading Computations from ASTScope Remove unnecessary dependency sources Remove Reference::cascades Remove DependencyScope Remove evaluator::getScopeForAccessLevel Remove DeclContext::isCascadingContextForLookup Remove NLOptions::NL_Known* Remove NameLookupFlags::KnownPrivate Remove UnqualifiedLookupFlags::KnownPrivate Remove TypeResolutionFlags::KnownNonCascadingDependency [leaks-checker] Add verbose flag to dump out raw output from runtime to help debug failures on bots.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We don't emit unreachable code diagnostic for single expression closures if it has an implicit return. For example:
This is because we skip implicit statements in SILGen if we encounter an unreachable location.
For implicit return statements in single expression closure or functions, the result expression is not implicit. So, let's use this knowledge to prevent skipping over the return statement.
Resolves SR-13432