Skip to content

Commit 05ac7e3

Browse files
committed
AST: Fix NominalType::get() when given a BuiltinTupleDecl
1 parent 1bcceda commit 05ac7e3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/AST/ASTContext.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3726,7 +3726,9 @@ BoundGenericType *BoundGenericType::get(NominalTypeDecl *TheDecl,
37263726
}
37273727

37283728
NominalType *NominalType::get(NominalTypeDecl *D, Type Parent, const ASTContext &C) {
3729-
assert((isa<ProtocolDecl>(D) || !D->getGenericParams()) &&
3729+
assert((isa<ProtocolDecl>(D) ||
3730+
isa<BuiltinTupleDecl>(D) ||
3731+
!D->getGenericParams()) &&
37303732
"must be a non-generic type decl");
37313733
assert((!Parent || Parent->is<NominalType>() ||
37323734
Parent->is<BoundGenericType>() ||
@@ -3742,6 +3744,8 @@ NominalType *NominalType::get(NominalTypeDecl *D, Type Parent, const ASTContext
37423744
return ClassType::get(cast<ClassDecl>(D), Parent, C);
37433745
case DeclKind::Protocol: {
37443746
return ProtocolType::get(cast<ProtocolDecl>(D), Parent, C);
3747+
case DeclKind::BuiltinTuple:
3748+
return BuiltinTupleType::get(cast<BuiltinTupleDecl>(D), Parent, C);
37453749
}
37463750

37473751
default:

0 commit comments

Comments
 (0)