Skip to content

Commit 6b1c681

Browse files
committed
Skip check when apparent type of source is never
1 parent 0d99510 commit 6b1c681

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15487,7 +15487,7 @@ namespace ts {
1548715487
// }
1548815488
if (result && (
1548915489
target.flags & TypeFlags.Intersection && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
15490-
isNonGenericObjectType(target) && source.flags & TypeFlags.Intersection && !some((<IntersectionType>source).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType)))) {
15490+
isNonGenericObjectType(target) && source.flags & TypeFlags.Intersection && !some((<IntersectionType>source).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType)) && !(getApparentType(source).flags & TypeFlags.Never))) {
1549115491
result &= recursiveTypeRelatedTo(source, target, reportErrors, IntersectionState.PropertyCheck);
1549215492
}
1549315493

0 commit comments

Comments
 (0)