Skip to content

Commit 3ffda7e

Browse files
committed
[ASTManger] Refactor parameter mangling code a bit based on feedback
1 parent e50537d commit 3ffda7e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,9 +1799,8 @@ void ASTMangler::appendTypeList(Type listTy) {
17991799

18001800
void ASTMangler::appendTypeListElement(Identifier name, Type elementType,
18011801
ParameterTypeFlags flags) {
1802-
if (flags.isAutoClosure())
1803-
appendFunctionType(elementType->castTo<FunctionType>(),
1804-
/*isAutoClosure*/ true);
1802+
if (auto *fnType = elementType->getAs<FunctionType>())
1803+
appendFunctionType(fnType, flags.isAutoClosure());
18051804
else
18061805
appendType(elementType);
18071806

0 commit comments

Comments
 (0)