@@ -49915,7 +49915,7 @@ var ts;
4991549915 if (sourceProperty === targetProperty)
4991649916 return "continue";
4991749917 // We compare the source property to the target in the context of a single discriminant type.
49918- var related = propertyRelatedTo(source, target, sourceProperty, targetProperty, function (_) { return combination[i]; }, /*reportErrors*/ false, 0 /* None */);
49918+ var related = propertyRelatedTo(source, target, sourceProperty, targetProperty, function (_) { return combination[i]; }, /*reportErrors*/ false, 0 /* None */, /*skipOptional*/ strictNullChecks || relation === comparableRelation );
4991949919 // If the target property could not be found, or if the properties were not related,
4992049920 // then this constituent is not a match.
4992149921 if (!related) {
@@ -50023,7 +50023,7 @@ var ts;
5002350023 return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors, /*headMessage*/ undefined, intersectionState);
5002450024 }
5002550025 }
50026- function propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState) {
50026+ function propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState, skipOptional ) {
5002750027 var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp);
5002850028 var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp);
5002950029 if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) {
@@ -50062,7 +50062,7 @@ var ts;
5006250062 return 0 /* False */;
5006350063 }
5006450064 // When checking for comparability, be more lenient with optional properties.
50065- if (relation !== comparableRelation && sourceProp.flags & 16777216 /* Optional */ && !(targetProp.flags & 16777216 /* Optional */)) {
50065+ if (!skipOptional && sourceProp.flags & 16777216 /* Optional */ && !(targetProp.flags & 16777216 /* Optional */)) {
5006650066 // TypeScript 1.0 spec (April 2014): 3.8.3
5006750067 // S is a subtype of a type T, and T is a supertype of S if ...
5006850068 // S' and T are object types and, for each member M in T..
@@ -50187,7 +50187,7 @@ var ts;
5018750187 if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) {
5018850188 var sourceProp = getPropertyOfType(source, name);
5018950189 if (sourceProp && sourceProp !== targetProp) {
50190- var related = propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSymbol, reportErrors, intersectionState);
50190+ var related = propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSymbol, reportErrors, intersectionState, relation === comparableRelation );
5019150191 if (!related) {
5019250192 return 0 /* False */;
5019350193 }
0 commit comments