Skip to content

Commit 0feacec

Browse files
committed
[CS] Fix an over-eager assert
We can in fact have placeholders here if the type is bound to a hole.
1 parent 1bb65d8 commit 0feacec

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/Sema/CSSyntacticElement.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,7 @@ class SyntacticElementConstraintGenerator
803803
auto projectedTy = computeProjectedValueType(wrappedVar, wrapperTy);
804804
// The projected type may have an error, make sure we turn it into a hole
805805
// if necessary.
806-
ASSERT(!projectedTy->hasUnboundGenericType() &&
807-
!projectedTy->hasPlaceholder());
806+
ASSERT(!projectedTy->hasUnboundGenericType());
808807
projectedTy = cs.replaceInferableTypesWithTypeVars(projectedTy, locator);
809808
cs.setType(projectedVal, projectedTy);
810809
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// {"kind":"typecheck","original":"25782df5","signature":"(anonymous namespace)::SyntacticElementConstraintGenerator::visitDecl(swift::Decl*)","signatureAssert":"Assertion failed: (!projectedTy->hasUnboundGenericType() && !projectedTy->hasPlaceholder()), function setPropertyWrapperAuxiliaryTypes"}
2+
// RUN: not %target-swift-frontend -typecheck %s
3+
@propertyWrapper
4+
struct a<
5+
b
6+
> {
7+
projectedValue : Self var wrappedValue: b
8+
}
9+
{
10+
@a var c: <#type#>
11+
}

0 commit comments

Comments
 (0)