Skip to content

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 8 commits into from
May 3, 2016

Conversation

cwillmor
Copy link
Contributor

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:

  • Test pull request on Swift continuous integration.

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

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

…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.
@cwillmor cwillmor changed the title Initial implementation of SE-0054 Initial implementation of SE-0054 "Abolish IUO Type" Apr 27, 2016
@cwillmor
Copy link
Contributor Author

@swift-ci please test

@cwillmor
Copy link
Contributor Author

Looks like I need to update the benchmark suite.

@cwillmor
Copy link
Contributor Author

@swift-ci please test

@cwillmor
Copy link
Contributor Author

cwillmor commented May 3, 2016

swiftpm changes here: swiftlang/swift-package-manager#295
swift-corelibs-foundation changes here: swiftlang/swift-corelibs-foundation#343

@cwillmor cwillmor merged commit af0c7bd into swiftlang:master May 3, 2016
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant