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(
3990
3990
3991
3991
llvm::SmallSetVector<FixInContext, 4 > fixes;
3992
3992
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
+
3994
3999
fixes.insert ({&solution, fix});
4000
+ }
3995
4001
}
3996
4002
3997
4003
llvm::MapVector<ConstraintLocator *, SmallVector<FixInContext, 4 >>
Original file line number Diff line number Diff line change @@ -1163,3 +1163,13 @@ func rdar78917861() {
1163
1163
} ( )
1164
1164
}
1165
1165
}
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