Discriminate types with divergent read/write property types (#55576)

This commit is contained in:
Mateusz Burzyński
2023-08-30 23:55:11 +02:00
committed by GitHub
parent 08e0eb74e6
commit f424a6be05
25 changed files with 2086 additions and 1 deletions

View File

@@ -14389,7 +14389,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (writeTypes || writeType !== type) {
writeTypes = append(!writeTypes ? propTypes.slice() : writeTypes, writeType);
}
else if (type !== firstType) {
if (type !== firstType) {
checkFlags |= CheckFlags.HasNonUniformType;
}
if (isLiteralType(type) || isPatternLiteralType(type)) {