Skip to content

Commit 271ca80

Browse files
committed
Address PR comments
1 parent 11929e3 commit 271ca80

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7777,8 +7777,10 @@ namespace ts {
77777777
return related;
77787778
}
77797779
}
7780-
const discriminantType = findMatchingDiscriminantType(source, target);
7781-
isRelatedTo(source, discriminantType || targetTypes[targetTypes.length - 1], reportErrors);
7780+
if (reportErrors) {
7781+
const discriminantType = findMatchingDiscriminantType(source, target);
7782+
isRelatedTo(source, discriminantType || targetTypes[targetTypes.length - 1], /*reportErrors*/ true);
7783+
}
77827784
return Ternary.False;
77837785
}
77847786

0 commit comments

Comments
 (0)