Skip to content

Commit

Permalink
Merge pull request swiftlang#220 from cwillmor/master
Browse files Browse the repository at this point in the history
[SE-0054] Add section on effect of IUO removal on typedefs.
  • Loading branch information
lattner committed Mar 22, 2016
2 parents 3d73a61 + 52ec0a8 commit dec4305
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions proposals/0054-abolish-iuo.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,23 @@ Because IUOs are an attribute on declarations rather than on types, the
`ImplicitlyUnwrappedOptional<T>` syntax, is removed. Types with nested IUOs are
no longer allowed. This includes types such as `[Int!]` and `(Int!, Int!)`.

Type aliases may not have IUO information associated with them. Thus the
statement `typealias X = Int!` is illegal. This includes type aliases resulting
from imported `typedef` statements. For example, the Objective-C type
declaration

```Objective-C
typedef void (^ViewHandler)(NSView *);
```
... is imported as the Swift type declaration
```Swift
typealias ViewHandler = (NSView?) -> ()
```

Note that the parameter type is `NSView?`, not `NSView!`.

## Examples

```Swift
Expand Down

0 comments on commit dec4305

Please sign in to comment.