Skip to content

Commit

Permalink
[SE-0054] Add section on effect of IUO removal on typedefs.
Browse files Browse the repository at this point in the history
  • Loading branch information
cwillmor committed Mar 22, 2016
1 parent 3d73a61 commit 52ec0a8
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 52ec0a8

Please sign in to comment.