File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -8978,7 +8978,8 @@ static bool inferEnumMemberThroughTildeEqualsOperator(
8978
8978
}
8979
8979
}
8980
8980
8981
- cs.generateConstraints(target, FreeTypeVariableBinding::Disallow);
8981
+ if (cs.generateConstraints(target, FreeTypeVariableBinding::Disallow))
8982
+ return true;
8982
8983
8983
8984
// Sub-expression associated with expression pattern is the enum element
8984
8985
// access which needs to be connected to the provided element type.
Original file line number Diff line number Diff line change @@ -316,3 +316,16 @@ func test_wrapped_var_without_initializer() {
316
316
var v ;
317
317
}
318
318
}
319
+
320
+ // rdar://92366212 - crash in ConstraintSystem::getType
321
+ func test_unknown_refs_in_tilde_operator( ) {
322
+ enum E {
323
+ }
324
+
325
+ let _: ( E ) -> Void = {
326
+ if case . test( unknown) = $0 {
327
+ // expected-error@-1 {{type 'E' has no member 'test'}}
328
+ // expected-error@-2 2 {{cannot find 'unknown' in scope}}
329
+ }
330
+ }
331
+ }
You can’t perform that action at this time.
0 commit comments