Skip to content

Commit 38b004d

Browse files
committed
Tolerate missing Never types
This won't happen in "normal" Swift code, but can occur with tests that use `-parse-stdlib`.
1 parent 4b3d2f4 commit 38b004d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,7 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
29782978
Type neverType = getASTContext().getNeverType();
29792979
Type thrownError1 = func1->getEffectiveThrownInterfaceType().value_or(neverType);
29802980
Type thrownError2 = func2->getEffectiveThrownInterfaceType().value_or(neverType);
2981-
if (!thrownError1->isEqual(thrownError2)) {
2981+
if (thrownError1 && thrownError2 && !thrownError1->isEqual(thrownError2)) {
29822982
auto thrownErrorKind1 = getThrownErrorKind(thrownError1);
29832983
auto thrownErrorKind2 = getThrownErrorKind(thrownError2);
29842984

0 commit comments

Comments
 (0)