File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -348,4 +348,14 @@ func testSwitch(se: SomeEnum) {
348
348
case unsafe someEnumValue: break
349
349
default : break
350
350
}
351
+
352
+ if case someEnumValue = unsafe se { }
353
+ // expected-warning@-1{{expression uses unsafe constructs but is not marked with 'unsafe'}}{{11-11=unsafe }}
354
+ // expected-note@-2{{argument #0 in call to operator function '~=' has unsafe type 'SomeEnum'}}
355
+ // expected-note@-3{{argument #1 in call to operator function '~=' has unsafe type 'SomeEnum'}}
356
+ // expected-note@-4{{reference to unsafe type 'SomeEnum'}}
357
+ // expected-note@-5{{reference to unsafe var 'someEnumValue'}}
358
+ // expected-note@-6{{reference to let '$match' involves unsafe type 'SomeEnum'}}
359
+
360
+ if case unsafe someEnumValue = unsafe se { }
351
361
}
You can’t perform that action at this time.
0 commit comments