Use missingType instead of undefinedType for optional methods under exactOptionalPropertyTypes (#52519)

This commit is contained in:
Mateusz Burzyński
2023-03-01 20:25:39 +01:00
committed by GitHub
parent dcc766f2b2
commit fc756ebc17
6 changed files with 148 additions and 1 deletions

View File

@@ -11359,7 +11359,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type;
}
else {
return strictNullChecks && symbol.flags & SymbolFlags.Optional ? getOptionalType(type) : type;
return strictNullChecks && symbol.flags & SymbolFlags.Optional ? getOptionalType(type, /*isProperty*/ true) : type;
}
}