Skip to content

Commit 427bdc5

Browse files
committed
Return on ErrorType instead of destructuring
1 parent c0c7b45 commit 427bdc5

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/AST/Decl.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,12 +2226,7 @@ static Type mapSignatureFunctionType(ASTContext &ctx, Type type,
22262226
bool isMethod,
22272227
bool isInitializer,
22282228
unsigned curryLevels) {
2229-
if (auto errorType = type->getAs<ErrorType>()) {
2230-
if (auto originalType = errorType->getOriginalType()) {
2231-
return ErrorType::get(mapSignatureFunctionType(
2232-
ctx, originalType, topLevelFunction, isMethod, isInitializer,
2233-
curryLevels));
2234-
}
2229+
if (type->hasError()) {
22352230
return type;
22362231
}
22372232

0 commit comments

Comments
 (0)