mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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#>
|
||||
}
|
||||
Reference in New Issue
Block a user