diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8a1b9015150..3e8d5b86af7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9338,7 +9338,7 @@ namespace ts { } if (discriminant) { // check excess properties against discriminant type only, not the entire union - return hasExcessProperties(source, discriminant, undefined, reportErrors); + return hasExcessProperties(source, discriminant, /*discriminant*/ undefined, reportErrors); } for (const prop of getPropertiesOfObjectType(source)) { if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) {