File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -9589,7 +9589,7 @@ namespace ts {
95899589 // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the
95909590 // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks
95919591 // mode, if the underlying property is optional we remove 'undefined' from the type.
9592- prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType ) ? getOptionalType(propType) :
9592+ prop.type = strictNullChecks && isOptional && !maybeTypeOfKind(propType, TypeFlags.Undefined | TypeFlags.Void ) ? getOptionalType(propType) :
95939593 strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & SymbolFlags.Optional ? getTypeWithFacts(propType, TypeFacts.NEUndefined) :
95949594 propType;
95959595 if (modifiersProp) {
@@ -13681,7 +13681,7 @@ namespace ts {
1368113681 const templateMapper = combineTypeMappers(mapper, createTypeMapper([getTypeParameterFromMappedType(type)], [key]));
1368213682 const propType = instantiateType(getTemplateTypeFromMappedType(<MappedType>type.target || type), templateMapper);
1368313683 const modifiers = getMappedTypeModifiers(type);
13684- return strictNullChecks && modifiers & MappedTypeModifiers.IncludeOptional && !isTypeAssignableTo(undefinedType, propType ) ? getOptionalType(propType) :
13684+ return strictNullChecks && modifiers & MappedTypeModifiers.IncludeOptional && !maybeTypeOfKind(propType, TypeFlags.Undefined | TypeFlags.Void ) ? getOptionalType(propType) :
1368513685 strictNullChecks && modifiers & MappedTypeModifiers.ExcludeOptional && isOptional ? getTypeWithFacts(propType, TypeFacts.NEUndefined) :
1368613686 propType;
1368713687 }
You can’t perform that action at this time.
0 commit comments