-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Initial implementation of SE-0054 "Abolish IUO Type" #2322
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
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
…onal IUOs are only allowed on function decl arguments and return types, so don't import typedefs or function pointer args or return types as IUO.
When validating a TypeRepr, raise a diagnostic if an IUO is found anywhere other thn the top level or as a function parameter or return tpye.
When considering a constraint of the form '$T1 is convertible to T!', generate potential bindings 'T' and 'T?' for $T1, but not 'T!'. This prevents variables without explicit type information from ending up with IUO type. It also prevents implicit instantiation of functions and types with IUO type arguments.
@swift-ci please test |
Looks like I need to update the benchmark suite. |
@swift-ci please test |
swiftpm changes here: swiftlang/swift-package-manager#295 |
lmihalkovic
pushed a commit
to lmihalkovic/swift
that referenced
this pull request
May 29, 2016
This is a squash of the following commits: * [SE-0054] Import function pointer arg, return types, typedefs as optional IUOs are only allowed on function decl arguments and return types, so don't import typedefs or function pointer args or return types as IUO. * [SE-0054] Only allow IUOs in function arg and result type. When validating a TypeRepr, raise a diagnostic if an IUO is found anywhere other thn the top level or as a function parameter or return tpye. * [SE-0054] Disable inference of IUOs by default When considering a constraint of the form '$T1 is convertible to T!', generate potential bindings 'T' and 'T?' for $T1, but not 'T!'. This prevents variables without explicit type information from ending up with IUO type. It also prevents implicit instantiation of functions and types with IUO type arguments. * [SE-0054] Remove the -disable-infer-iuos flag. * Add nonnull annotations to ObjectiveCTests.h in benchmark suite.
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.
What's in this pull request?
This pull request implements SE-0054 by preventing IUO types from being inferred and prohibiting them in positions other than top-level or as function arguments or return values. It also limits the circumstances under which the Clang importer may import a pointer type as IUO.
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
Validation Testing
Note: Only members of the Apple organization can trigger swift-ci.