/
nonNullableAndObjectIntersections(strict=false).symbols
45 lines (33 loc) · 1.94 KB
/
nonNullableAndObjectIntersections(strict=false).symbols
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
=== tests/cases/compiler/nonNullableAndObjectIntersections.ts ===
// These should all resolve to never
type T0 = NonNullable<null>;
>T0 : Symbol(T0, Decl(nonNullableAndObjectIntersections.ts, 0, 0))
>NonNullable : Symbol(NonNullable, Decl(lib.es5.d.ts, --, --))
type T1 = NonNullable<undefined>;
>T1 : Symbol(T1, Decl(nonNullableAndObjectIntersections.ts, 2, 28))
>NonNullable : Symbol(NonNullable, Decl(lib.es5.d.ts, --, --))
type T2 = null & {};
>T2 : Symbol(T2, Decl(nonNullableAndObjectIntersections.ts, 3, 33))
type T3 = undefined & {};
>T3 : Symbol(T3, Decl(nonNullableAndObjectIntersections.ts, 4, 20))
type T4 = null & undefined;
>T4 : Symbol(T4, Decl(nonNullableAndObjectIntersections.ts, 5, 25))
type T6 = null & { a: string } & {};
>T6 : Symbol(T6, Decl(nonNullableAndObjectIntersections.ts, 6, 27))
>a : Symbol(a, Decl(nonNullableAndObjectIntersections.ts, 7, 18))
// Repro from #50519
type NonNullableNew<T> = T & {};
>NonNullableNew : Symbol(NonNullableNew, Decl(nonNullableAndObjectIntersections.ts, 7, 36))
>T : Symbol(T, Decl(nonNullableAndObjectIntersections.ts, 11, 20))
>T : Symbol(T, Decl(nonNullableAndObjectIntersections.ts, 11, 20))
type NonNullableOld<T> = T extends null | undefined ? never : T;
>NonNullableOld : Symbol(NonNullableOld, Decl(nonNullableAndObjectIntersections.ts, 11, 32))
>T : Symbol(T, Decl(nonNullableAndObjectIntersections.ts, 12, 20))
>T : Symbol(T, Decl(nonNullableAndObjectIntersections.ts, 12, 20))
>T : Symbol(T, Decl(nonNullableAndObjectIntersections.ts, 12, 20))
type TestNew = NonNullableNew<null>;
>TestNew : Symbol(TestNew, Decl(nonNullableAndObjectIntersections.ts, 12, 64))
>NonNullableNew : Symbol(NonNullableNew, Decl(nonNullableAndObjectIntersections.ts, 7, 36))
type TestOld = NonNullableOld<null>;
>TestOld : Symbol(TestOld, Decl(nonNullableAndObjectIntersections.ts, 14, 36))
>NonNullableOld : Symbol(NonNullableOld, Decl(nonNullableAndObjectIntersections.ts, 11, 32))