Skip to content

Commit 6bc3087

Browse files
committed
Only substitute into the error type when there are substitutions
1 parent 3482ca0 commit 6bc3087

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Sema/TypeCheckEffects.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,8 +1986,10 @@ class ApplyClassifier {
19861986

19871987
case EffectKind::Throws:
19881988
if (auto thrownError = fnType->getEffectiveThrownErrorType()) {
1989-
return Classification::forThrows(
1990-
thrownError->subst(subs), conditional, reason);
1989+
Type thrown = *thrownError;
1990+
if (subs)
1991+
thrown = thrown.subst(subs);
1992+
return Classification::forThrows(thrown, conditional, reason);
19911993
}
19921994

19931995
return Classification();

0 commit comments

Comments
 (0)