mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Redo in narrowing for intersections (#39637)
* Redo in-narrowing for intersections Still need to carve out an exception for globalThis * exempt globalThis from `in` narrowing
This commit is contained in:
committed by
GitHub
parent
32934a9989
commit
d3877d294c
@@ -103,3 +103,10 @@ function positiveIntersectionTest(x: { a: string } & { b: string }) {
|
||||
let n: never = x;
|
||||
}
|
||||
}
|
||||
function negativeIntersectionTest() {
|
||||
if ("ontouchstart" in window) {
|
||||
window.ontouchstart
|
||||
} else {
|
||||
window.ontouchstart
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user