Skip to content

Commit a0b573d

Browse files
committed
[AST] Concurrency: Strip existential if constrained type was stripped down to a class
`any C` where `C` is a class is not a well-formed type. (cherry picked from commit 10541ef)
1 parent 383c8c8 commit a0b573d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/AST/Type.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,9 @@ Type TypeBase::stripConcurrency(bool recurse, bool dropGlobalActor) {
989989
existentialType->getConstraintType().getPointer())
990990
return Type(this);
991991

992+
if (newConstraintType->getClassOrBoundGenericClass())
993+
return newConstraintType;
994+
992995
return ExistentialType::get(newConstraintType);
993996
}
994997

0 commit comments

Comments
 (0)