[CS] Fix an over-eager assert

We can in fact have placeholders here if the type is bound to a hole.
This commit is contained in:
Hamish Knight
2025-11-07 16:17:55 +00:00
parent 1bb65d8def
commit 0feacec63b
2 changed files with 12 additions and 2 deletions

View File

@@ -803,8 +803,7 @@ private:
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());
ASSERT(!projectedTy->hasUnboundGenericType());
projectedTy = cs.replaceInferableTypesWithTypeVars(projectedTy, locator);
cs.setType(projectedVal, projectedTy);
}

View File

@@ -0,0 +1,11 @@
// {"kind":"typecheck","original":"25782df5","signature":"(anonymous namespace)::SyntacticElementConstraintGenerator::visitDecl(swift::Decl*)","signatureAssert":"Assertion failed: (!projectedTy->hasUnboundGenericType() && !projectedTy->hasPlaceholder()), function setPropertyWrapperAuxiliaryTypes"}
// RUN: not %target-swift-frontend -typecheck %s
@propertyWrapper
struct a<
b
> {
projectedValue : Self var wrappedValue: b
}
{
@a var c: <#type#>
}