Skip to content

Commit fdc4e50

Browse files
committed
Just check for TypeFlags.Object
1 parent f393ac2 commit fdc4e50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15361,9 +15361,9 @@ namespace ts {
1536115361
* * Ternary.False if they are not related.
1536215362
*/
1536315363
function isRelatedTo(originalSource: Type, originalTarget: Type, reportErrors = false, headMessage?: DiagnosticMessage, intersectionState = IntersectionState.None): Ternary {
15364-
// Before normalization: if `source` is type reference (ergo an object), and `target` is primitive,
15364+
// Before normalization: if `source` is type an object type, and `target` is primitive,
1536515365
// skip all the checks we don't need and just return `isSimpleTypeRelatedTo` result
15366-
if (getObjectFlags(originalSource) & ObjectFlags.Reference && originalTarget.flags & TypeFlags.Primitive) {
15366+
if (originalSource.flags & TypeFlags.Object && originalTarget.flags & TypeFlags.Primitive) {
1536715367
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
1536815368
return Ternary.True;
1536915369
}

0 commit comments

Comments
 (0)