File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
lib/ASTGen/Sources/ASTGen Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,14 @@ extension ASTGenVisitor {
161161 // I'm not sure this should really be implicit.
162162 pat. setImplicit ( )
163163
164+ if let typeAnnotation = node. typeAnnotation {
165+ pat = BridgedTypedPattern . createParsed (
166+ self . ctx,
167+ pattern: pat,
168+ type: self . generate ( type: typeAnnotation. type)
169+ ) . asPattern
170+ }
171+
164172 let initializer : BridgedExpr
165173 if let initNode = node. initializer {
166174 initializer = self . generate ( expr: initNode. value)
Original file line number Diff line number Diff line change @@ -116,6 +116,17 @@ func testThen() {
116116 }
117117}
118118
119+ func intOrString( ) -> Int ? { 1 }
120+ func intOrString( ) -> String ? { " " }
121+ func testIf( ) {
122+ if
123+ let i: Int = intOrString ( ) ,
124+ case let str? = intOrString ( ) as String ?
125+ {
126+ _ = ( i, str)
127+ }
128+ }
129+
119130struct GenericTypeWithYields < T> {
120131 var storedProperty : T ?
121132
You can’t perform that action at this time.
0 commit comments