Skip to content

Commit dec4305

Browse files
committed
Merge pull request #220 from cwillmor/master
[SE-0054] Add section on effect of IUO removal on typedefs.
2 parents 3d73a61 + 52ec0a8 commit dec4305

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

proposals/0054-abolish-iuo.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,23 @@ Because IUOs are an attribute on declarations rather than on types, the
101101
`ImplicitlyUnwrappedOptional<T>` syntax, is removed. Types with nested IUOs are
102102
no longer allowed. This includes types such as `[Int!]` and `(Int!, Int!)`.
103103

104+
Type aliases may not have IUO information associated with them. Thus the
105+
statement `typealias X = Int!` is illegal. This includes type aliases resulting
106+
from imported `typedef` statements. For example, the Objective-C type
107+
declaration
108+
109+
```Objective-C
110+
typedef void (^ViewHandler)(NSView *);
111+
```
112+
113+
... is imported as the Swift type declaration
114+
115+
```Swift
116+
typealias ViewHandler = (NSView?) -> ()
117+
```
118+
119+
Note that the parameter type is `NSView?`, not `NSView!`.
120+
104121
## Examples
105122

106123
```Swift

0 commit comments

Comments
 (0)