@@ -1241,7 +1241,8 @@ namespace {
1241
1241
if (knownType &&
1242
1242
(knownType->hasUnboundGenericType () ||
1243
1243
knownType->hasPlaceholder ())) {
1244
- knownType = CS.convertInferableTypes (knownType, locator);
1244
+ knownType = CS.replaceInferableTypesWithTypeVars (knownType,
1245
+ locator);
1245
1246
}
1246
1247
1247
1248
CS.setType (
@@ -1311,7 +1312,7 @@ namespace {
1311
1312
if (E->isImplicit ()) {
1312
1313
type = CS.getInstanceType (CS.cacheType (E));
1313
1314
assert (type && " Implicit type expr must have type set!" );
1314
- type = CS.convertInferableTypes (type, locator);
1315
+ type = CS.replaceInferableTypesWithTypeVars (type, locator);
1315
1316
} else if (CS.hasType (E)) {
1316
1317
// If there's a type already set into the constraint system, honor it.
1317
1318
// FIXME: This supports the result builder transform, which sneakily
@@ -1992,7 +1993,8 @@ namespace {
1992
1993
Type externalType;
1993
1994
if (param->getTypeRepr ()) {
1994
1995
auto declaredTy = CS.getVarType (param);
1995
- externalType = CS.convertInferableTypes (declaredTy, paramLoc);
1996
+ externalType = CS.replaceInferableTypesWithTypeVars (declaredTy,
1997
+ paramLoc);
1996
1998
} else {
1997
1999
// Let's allow parameters which haven't been explicitly typed
1998
2000
// to become holes by default, this helps in situations like
@@ -2208,7 +2210,7 @@ namespace {
2208
2210
// Look through reference storage types.
2209
2211
type = type->getReferenceStorageReferent ();
2210
2212
2211
- Type openedType = CS.convertInferableTypes (type, locator);
2213
+ Type openedType = CS.replaceInferableTypesWithTypeVars (type, locator);
2212
2214
assert (openedType);
2213
2215
2214
2216
auto *subPattern = cast<TypedPattern>(pattern)->getSubPattern ();
@@ -2369,7 +2371,8 @@ namespace {
2369
2371
// contained within the type resolver.
2370
2372
if (const auto preresolvedTy = enumPattern->getParentType ()) {
2371
2373
const auto openedTy =
2372
- CS.convertInferableTypes (preresolvedTy, patternMatchLoc);
2374
+ CS.replaceInferableTypesWithTypeVars (preresolvedTy,
2375
+ patternMatchLoc);
2373
2376
assert (openedTy);
2374
2377
return openedTy;
2375
2378
}
@@ -3575,7 +3578,8 @@ static bool generateWrappedPropertyTypeConstraints(
3575
3578
auto *typeRepr = wrapperAttributes[i]->getTypeRepr ();
3576
3579
auto *locator =
3577
3580
cs.getConstraintLocator (typeRepr, LocatorPathElt::ContextualType ());
3578
- wrapperType = cs.convertInferableTypes (rawWrapperType, locator);
3581
+ wrapperType = cs.replaceInferableTypesWithTypeVars (rawWrapperType,
3582
+ locator);
3579
3583
cs.addConstraint (ConstraintKind::Equal, wrapperType, wrappedValueType,
3580
3584
locator);
3581
3585
cs.setContextualType (typeRepr, TypeLoc::withoutLoc (wrappedValueType),
@@ -3886,8 +3890,8 @@ bool ConstraintSystem::generateConstraints(
3886
3890
auto *wrappedVar = target.getAsUninitializedWrappedVar ();
3887
3891
auto *outermostWrapper = wrappedVar->getAttachedPropertyWrappers ().front ();
3888
3892
auto *typeRepr = outermostWrapper->getTypeRepr ();
3889
- auto backingType = convertInferableTypes (outermostWrapper-> getType (),
3890
- getConstraintLocator (typeRepr));
3893
+ auto backingType = replaceInferableTypesWithTypeVars (
3894
+ outermostWrapper-> getType (), getConstraintLocator (typeRepr));
3891
3895
setType (typeRepr, backingType);
3892
3896
3893
3897
auto propertyType = getVarType (wrappedVar);
0 commit comments