mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
* Fix #38608 * Work for narrowed non-unions * Add comment
This commit is contained in:
1 parent
79d3058b83
commit
3d6650eb4f
9 files changed
+369
-11
No files matched your search
@@ -22963,7 +22963,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
function narrowByInKeyword(type: Type, literal: LiteralExpression, assumeTrue: boolean) {
|
||||
if (type.flags & (TypeFlags.Union | TypeFlags.Object)
|
||||
if (type.flags & TypeFlags.Union
|
||||
|| type.flags & TypeFlags.Object && declaredType !== type
|
||||
|| isThisTypeParameter(type)
|
||||
|| type.flags & TypeFlags.Intersection && every((type as IntersectionType).types, t => t.symbol !== globalThisSymbol)) {
|
||||
const propName = escapeLeadingUnderscores(literal.text);
|
||||
|
||||
Reference in new issue
Block a user