Skip to content

Commit 256f349

Browse files
committed
AST: Fix GenericSignature::requiresClass() for layout
We forgot to check for a layout constraint here.
1 parent db58e02 commit 256f349

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/AST/GenericSignature.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,11 @@ bool GenericSignature::requiresClass(Type type, ModuleDecl &mod) {
498498
// requirement.
499499
if (pa->isConcreteType()) return false;
500500

501+
// If there is a layout constraint, it might be a class.
502+
if (auto layout = pa->getLayout())
503+
if (layout->isClass())
504+
return true;
505+
501506
// If there is a superclass bound, then obviously it must be a class.
502507
if (pa->getSuperclass()) return true;
503508

0 commit comments

Comments
 (0)