Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/Sema/CSSyntacticElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,11 @@ class SyntacticElementConstraintGenerator
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())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// {"kind":"complete","original":"3da7ab26","signature":"swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::constraints::SyntacticElementTarget)","signatureAssert":"Assertion failed: (isValidType(solution.simplifyType(type)) && \"node type has invalid type\"), function applySolution"}
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
@propertyWrapper struct a<b {
init(wrappedValue: b)
projectedValue:
var wrappedValue: b
}
{
@a var c = false
switch c {
#^^#
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// {"kind":"typecheck","signature":"swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::constraints::SyntacticElementTarget)","signatureAssert":"Assertion failed: (isValidType(solution.simplifyType(type)) && \"node type has invalid type\"), function applySolution"}
// RUN: not %target-swift-frontend -typecheck %s
@propertyWrapper struct a<b > {
init(wrappedValue: b)
projectedValue:
var wrappedValue: b
}
{
@a var c = false
}