mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ConstraintSystem] Bind holes to UnresolvedType instead of Any.
This commit is contained in:
@@ -2313,7 +2313,7 @@ Type simplifyTypeImpl(const ConstraintSystem &cs, Type type,
|
||||
});
|
||||
}
|
||||
|
||||
Type ConstraintSystem::simplifyType(Type type) const {
|
||||
Type ConstraintSystem::simplifyType(Type type, bool forDiagnostics) const {
|
||||
if (!type->hasTypeVariable())
|
||||
return type;
|
||||
|
||||
@@ -2321,8 +2321,13 @@ Type ConstraintSystem::simplifyType(Type type) const {
|
||||
return simplifyTypeImpl(
|
||||
*this, type,
|
||||
[&](TypeVariableType *tvt) -> Type {
|
||||
if (auto fixed = getFixedType(tvt))
|
||||
if (auto fixed = getFixedType(tvt)) {
|
||||
if (forDiagnostics && fixed->isHole() &&
|
||||
tvt->getImpl().getLocator()->isForGenericParameter())
|
||||
return tvt->getImpl().getLocator()->getGenericParameter();
|
||||
|
||||
return simplifyType(fixed);
|
||||
}
|
||||
|
||||
return getRepresentative(tvt);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user