File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -3990,8 +3990,14 @@ bool ConstraintSystem::diagnoseAmbiguityWithFixes(
39903990
39913991 llvm::SmallSetVector<FixInContext, 4 > fixes;
39923992 for (auto &solution : solutions) {
3993- for (auto *fix : solution.Fixes )
3993+ for (auto *fix : solution.Fixes ) {
3994+ // Ignore warnings in favor of actual error fixes,
3995+ // because they are not the source of ambiguity/failures.
3996+ if (fix->isWarning ())
3997+ continue ;
3998+
39943999 fixes.insert ({&solution, fix});
4000+ }
39954001 }
39964002
39974003 llvm::MapVector<ConstraintLocator *, SmallVector<FixInContext, 4 >>
Original file line number Diff line number Diff line change @@ -1163,3 +1163,13 @@ func rdar78917861() {
11631163 } ( )
11641164 }
11651165}
1166+
1167+ // rdar://81228501 - type-checker crash due to applied invalid solution
1168+ func test( arr: [ [ Int] ] ) {
1169+ struct A {
1170+ init ( arg: [ Int ] ) { }
1171+ }
1172+
1173+ arr. map { ( $0 as? [ Int ] ) . map { A ( $0) } } // expected-error {{missing argument label 'arg:' in call}} {{36-36=arg: }}
1174+ // expected-warning@-1 {{conditional cast from '[Int]' to '[Int]' always succeeds}}
1175+ }
You can’t perform that action at this time.
0 commit comments