File: nonPrimitiveAndTypeVariables.symbols

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (52 lines) | stat: -rw-r--r-- 2,532 bytes parent folder | download | duplicates (5)
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
46
47
48
49
50
51
52
=== tests/cases/conformance/types/nonPrimitive/nonPrimitiveAndTypeVariables.ts ===
// Repros from #23800

type A<T, V> = { [P in keyof T]: T[P] extends V ? 1 : 0; };
>A : Symbol(A, Decl(nonPrimitiveAndTypeVariables.ts, 0, 0))
>T : Symbol(T, Decl(nonPrimitiveAndTypeVariables.ts, 2, 7))
>V : Symbol(V, Decl(nonPrimitiveAndTypeVariables.ts, 2, 9))
>P : Symbol(P, Decl(nonPrimitiveAndTypeVariables.ts, 2, 18))
>T : Symbol(T, Decl(nonPrimitiveAndTypeVariables.ts, 2, 7))
>T : Symbol(T, Decl(nonPrimitiveAndTypeVariables.ts, 2, 7))
>P : Symbol(P, Decl(nonPrimitiveAndTypeVariables.ts, 2, 18))
>V : Symbol(V, Decl(nonPrimitiveAndTypeVariables.ts, 2, 9))

type B<T, V> = { [P in keyof T]: T[P] extends V | object ? 1 : 0; };
>B : Symbol(B, Decl(nonPrimitiveAndTypeVariables.ts, 2, 59))
>T : Symbol(T, Decl(nonPrimitiveAndTypeVariables.ts, 3, 7))
>V : Symbol(V, Decl(nonPrimitiveAndTypeVariables.ts, 3, 9))
>P : Symbol(P, Decl(nonPrimitiveAndTypeVariables.ts, 3, 18))
>T : Symbol(T, Decl(nonPrimitiveAndTypeVariables.ts, 3, 7))
>T : Symbol(T, Decl(nonPrimitiveAndTypeVariables.ts, 3, 7))
>P : Symbol(P, Decl(nonPrimitiveAndTypeVariables.ts, 3, 18))
>V : Symbol(V, Decl(nonPrimitiveAndTypeVariables.ts, 3, 9))

let a: A<{ a: 0 | 1 }, 0> = { a: 0 };
>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 5, 3))
>A : Symbol(A, Decl(nonPrimitiveAndTypeVariables.ts, 0, 0))
>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 5, 10))
>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 5, 29))

let b: B<{ a: 0 | 1 }, 0> = { a: 0 };
>b : Symbol(b, Decl(nonPrimitiveAndTypeVariables.ts, 6, 3))
>B : Symbol(B, Decl(nonPrimitiveAndTypeVariables.ts, 2, 59))
>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 6, 10))
>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 6, 29))

function foo<T, U>(x: T) {
>foo : Symbol(foo, Decl(nonPrimitiveAndTypeVariables.ts, 6, 37))
>T : Symbol(T, Decl(nonPrimitiveAndTypeVariables.ts, 8, 13))
>U : Symbol(U, Decl(nonPrimitiveAndTypeVariables.ts, 8, 15))
>x : Symbol(x, Decl(nonPrimitiveAndTypeVariables.ts, 8, 19))
>T : Symbol(T, Decl(nonPrimitiveAndTypeVariables.ts, 8, 13))

    let a: object = x;  // Error
>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 9, 7))
>x : Symbol(x, Decl(nonPrimitiveAndTypeVariables.ts, 8, 19))

    let b: U | object = x;  // Error
>b : Symbol(b, Decl(nonPrimitiveAndTypeVariables.ts, 10, 7))
>U : Symbol(U, Decl(nonPrimitiveAndTypeVariables.ts, 8, 15))
>x : Symbol(x, Decl(nonPrimitiveAndTypeVariables.ts, 8, 19))
}