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(
89788978 }
89798979 }
89808980
8981- cs.generateConstraints(target, FreeTypeVariableBinding::Disallow);
8981+ if (cs.generateConstraints(target, FreeTypeVariableBinding::Disallow))
8982+ return true;
89828983
89838984 // Sub-expression associated with expression pattern is the enum element
89848985 // 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() {
316316 var v ;
317317 }
318318}
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