Skip to content

Commit 1801bbd

Browse files
committed
Sema: Fix crash on invalid code in isOverrideBasedOnType()
1 parent 2704dbe commit 1801bbd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Sema/TypeCheckDeclOverride.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ bool swift::isOverrideBasedOnType(const ValueDecl *decl, Type declTy,
217217
return false;
218218
}
219219

220+
if (declTy->is<ErrorType>())
221+
return false;
222+
220223
auto fnType1 = declTy->castTo<AnyFunctionType>();
221224
auto fnType2 = parentDeclTy->castTo<AnyFunctionType>();
222225
return AnyFunctionType::equalParams(fnType1->getParams(),

0 commit comments

Comments
 (0)