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(
66836683 if (rhs->isExistentialType())
66846684 break;
66856685
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-
66926686 conversionsOrFixes.push_back(CollectionElementContextualMismatch::create(
66936687 *this, lhs, rhs, getConstraintLocator(locator)));
66946688 break;
@@ -6782,9 +6776,6 @@ bool ConstraintSystem::repairFailures(
67826776
67836777 case ConstraintLocator::TernaryBranch:
67846778 case ConstraintLocator::SingleValueStmtResult: {
6785- recordAnyTypeVarAsPotentialHole(lhs);
6786- recordAnyTypeVarAsPotentialHole(rhs);
6787-
67886779 if (lhs->hasPlaceholder() || rhs->hasPlaceholder())
67896780 return true;
67906781
@@ -6852,8 +6843,6 @@ bool ConstraintSystem::repairFailures(
68526843 return true;
68536844
68546845 if (isMemberMatch) {
6855- recordAnyTypeVarAsPotentialHole(lhs);
6856- recordAnyTypeVarAsPotentialHole(rhs);
68576846 conversionsOrFixes.push_back(AllowAssociatedValueMismatch::create(
68586847 *this, lhs, rhs, getConstraintLocator(locator)));
68596848 break;
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ let _: () -> Void = {
99
1010let _: ( ) -> Void = {
1111 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 ?'}}
1313 if case ( 0 , 0 ) = a { }
1414}
1515
1616let _: ( ) -> Void = {
1717 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 ?'}}
1919 for case (0 , 0 ) in [ a] { }
2020}
2121
You can’t perform that action at this time.
0 commit comments