Skip to content

Commit e21c179

Browse files
committed
[Typechecker] Use an equal constraint between a property wrapper's value type and the pattern init
1 parent e05f800 commit e21c179

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,7 +2632,7 @@ bool TypeChecker::typeCheckBinding(Pattern *&pattern, Expr *&initializer,
26322632
emptyLocator);
26332633
return propertyType;
26342634
}
2635-
2635+
26362636
// Otherwise, compute the wrapped value type directly.
26372637
return computeWrappedValueType(wrappedVar, initType);
26382638
}
@@ -2654,10 +2654,10 @@ bool TypeChecker::typeCheckBinding(Pattern *&pattern, Expr *&initializer,
26542654
// is the initialization of the property wrapper instance.
26552655
initType = cs.getType(expr);
26562656

2657-
// Add a conversion constraint between the pattern type and the
2657+
// Add an equal constraint between the pattern type and the
26582658
// property wrapper's "value" type.
2659-
cs.addConstraint(ConstraintKind::Conversion, patternType,
2660-
getPatternInitType(&cs), Locator, /*isFavored*/true);
2659+
cs.addConstraint(ConstraintKind::Equal, patternType,
2660+
getPatternInitType(&cs), Locator, /*isFavored*/ true);
26612661
} else {
26622662
// The initializer type is the type of the pattern.
26632663
initType = patternType;

0 commit comments

Comments
 (0)