mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Fix compiler_crasher with FixKind::ForceOptional
We were using getRValueType() and getRValueObjectType() when setting up the constraint, but getRValueType() when simplifying it. This led to a crash if the type was a single-argument tuple with a named argument. Swift SVN r29376
This commit is contained in:
@@ -4389,8 +4389,8 @@ ConstraintSystem::simplifyFixConstraint(Fix fix,
|
||||
|
||||
case FixKind::ForceOptional:
|
||||
// Assume that '!' was applied to the first type.
|
||||
return matchTypes(type1->getRValueType()->getOptionalObjectType(), type2,
|
||||
matchKind, subFlags, locator);
|
||||
return matchTypes(type1->getRValueObjectType()->getOptionalObjectType(),
|
||||
type2, matchKind, subFlags, locator);
|
||||
|
||||
case FixKind::ForceDowncast:
|
||||
// These work whenever they are suggested.
|
||||
|
||||
Reference in New Issue
Block a user