Skip to content

Commit 2beca5c

Browse files
committed
Only check when apparent type of source is a structured type
1 parent 7c72e9a commit 2beca5c

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
@@ -15628,7 +15628,7 @@ namespace ts {
1562815628
// }
1562915629
if (result && (
1563015630
target.flags & TypeFlags.Intersection && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
15631-
isNonGenericObjectType(target) && source.flags & TypeFlags.Intersection && !some((<IntersectionType>source).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType)) && !(getApparentType(source).flags & TypeFlags.Never))) {
15631+
isNonGenericObjectType(target) && source.flags & TypeFlags.Intersection && getApparentType(source).flags & TypeFlags.StructuredType && !some((<IntersectionType>source).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType)))) {
1563215632
result &= recursiveTypeRelatedTo(source, target, reportErrors, IntersectionState.PropertyCheck);
1563315633
}
1563415634

0 commit comments

Comments
 (0)