File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -5093,7 +5093,7 @@ bool ConstraintSystem::repairFailures(
5093
5093
if (auto objType = valueType->getOptionalObjectType())
5094
5094
valueType = objType;
5095
5095
5096
- if (rawReprType->isTypeVariableOrMember())
5096
+ if (rawReprType->isTypeVariableOrMember() || rawReprType->isPlaceholder() )
5097
5097
return false;
5098
5098
5099
5099
auto rawValue = isRawRepresentable(*this, rawReprType);
@@ -5350,6 +5350,11 @@ bool ConstraintSystem::repairFailures(
5350
5350
if (repairByUsingRawValueOfRawRepresentableType(lhs, rhs))
5351
5351
return true;
5352
5352
5353
+ // If either side is a placeholder then let's consider this
5354
+ // assignment correctly typed.
5355
+ if (lhs->isPlaceholder() || rhs->isPlaceholder())
5356
+ return true;
5357
+
5353
5358
// Let's try to match source and destination types one more
5354
5359
// time to see whether they line up, if they do - the problem is
5355
5360
// related to immutability, otherwise it's a type mismatch.
Original file line number Diff line number Diff line change @@ -722,3 +722,15 @@ do {
722
722
_ = value. data. key // Ok
723
723
}
724
724
}
725
+
726
+ // rdar://110847476 - unrelated assignment and raw representable diagnostics
727
+ do {
728
+ struct Test < each Base : AsyncSequence > {
729
+ let base : ( repeat each Base )
730
+
731
+ init ( base: repeat each Base ) {
732
+ self . base = base
733
+ // expected-error@-1 {{pack reference 'each Base' can only appear in pack expansion}}
734
+ }
735
+ }
736
+ }
You can’t perform that action at this time.
0 commit comments