File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed
validation-test/Sema/type_checker_crashers_fixed Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -6683,12 +6683,6 @@ bool ConstraintSystem::repairFailures(
6683
6683
if (rhs->isExistentialType())
6684
6684
break;
6685
6685
6686
- // If the types didn't line up, let's allow right-hand side
6687
- // of the conversion (or pattern match) to have holes. This
6688
- // helps when conversion if between a type and a tuple e.g.
6689
- // `Int` vs. `(_, _)`.
6690
- recordAnyTypeVarAsPotentialHole(rhs);
6691
-
6692
6686
conversionsOrFixes.push_back(CollectionElementContextualMismatch::create(
6693
6687
*this, lhs, rhs, getConstraintLocator(locator)));
6694
6688
break;
@@ -6782,9 +6776,6 @@ bool ConstraintSystem::repairFailures(
6782
6776
6783
6777
case ConstraintLocator::TernaryBranch:
6784
6778
case ConstraintLocator::SingleValueStmtResult: {
6785
- recordAnyTypeVarAsPotentialHole(lhs);
6786
- recordAnyTypeVarAsPotentialHole(rhs);
6787
-
6788
6779
if (lhs->hasPlaceholder() || rhs->hasPlaceholder())
6789
6780
return true;
6790
6781
@@ -6852,8 +6843,6 @@ bool ConstraintSystem::repairFailures(
6852
6843
return true;
6853
6844
6854
6845
if (isMemberMatch) {
6855
- recordAnyTypeVarAsPotentialHole(lhs);
6856
- recordAnyTypeVarAsPotentialHole(rhs);
6857
6846
conversionsOrFixes.push_back(AllowAssociatedValueMismatch::create(
6858
6847
*this, lhs, rhs, getConstraintLocator(locator)));
6859
6848
break;
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ let _: () -> Void = {
9
9
10
10
let _: ( ) -> Void = {
11
11
for case (0 ) ? in [ a] { }
12
- // expected-error@-1 {{pattern cannot match values of type 'Any?'}}
12
+ // expected-error@-1 {{cannot convert sequence element type 'Any?' to expected type 'Int ?'}}
13
13
if case ( 0 , 0 ) = a { }
14
14
}
15
15
16
16
let _: ( ) -> Void = {
17
17
for case (0 ) ? in [ a] { }
18
- // expected-error@-1 {{pattern cannot match values of type 'Any?'}}
18
+ // expected-error@-1 {{cannot convert sequence element type 'Any?' to expected type 'Int ?'}}
19
19
for case (0 , 0 ) in [ a] { }
20
20
}
21
21
You can’t perform that action at this time.
0 commit comments