[CS] Replace error type with hole for projected value

Missed this in my previous patch, make sure we replace an error with
a hole if necessary.
This commit is contained in:
Hamish Knight
2025-11-05 20:29:15 +00:00
parent dad263728f
commit f205f469a9
3 changed files with 26 additions and 0 deletions

View File

@@ -801,6 +801,11 @@ private:
auto wrapperTy = cs.simplifyType(cs.getType(wrapperTypeExpr));
if (auto *projectedVal = wrappedVar->getPropertyWrapperProjectionVar()) {
auto projectedTy = computeProjectedValueType(wrappedVar, wrapperTy);
// The projected type may have an error, make sure we turn it into a hole
// if necessary.
ASSERT(!projectedTy->hasUnboundGenericType() &&
!projectedTy->hasPlaceholder());
projectedTy = cs.replaceInferableTypesWithTypeVars(projectedTy, locator);
cs.setType(projectedVal, projectedTy);
}
if (auto *backing = wrappedVar->getPropertyWrapperBackingProperty())