File: neverTypeErrors1.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (94 lines) | stat: -rw-r--r-- 2,211 bytes parent folder | download | duplicates (3)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
=== tests/cases/conformance/types/never/neverTypeErrors1.ts ===
function f1() {
>f1 : Symbol(f1, Decl(neverTypeErrors1.ts, 0, 0))

    let x: never;
>x : Symbol(x, Decl(neverTypeErrors1.ts, 1, 7))

    x = 1;
>x : Symbol(x, Decl(neverTypeErrors1.ts, 1, 7))

    x = "abc";
>x : Symbol(x, Decl(neverTypeErrors1.ts, 1, 7))

    x = false;
>x : Symbol(x, Decl(neverTypeErrors1.ts, 1, 7))

    x = undefined;
>x : Symbol(x, Decl(neverTypeErrors1.ts, 1, 7))
>undefined : Symbol(undefined)

    x = null;
>x : Symbol(x, Decl(neverTypeErrors1.ts, 1, 7))

    x = {};
>x : Symbol(x, Decl(neverTypeErrors1.ts, 1, 7))

    x();
>x : Symbol(x, Decl(neverTypeErrors1.ts, 1, 7))
}

function f2(): never {
>f2 : Symbol(f2, Decl(neverTypeErrors1.ts, 9, 1))

    return;
}

function f3(): never {
>f3 : Symbol(f3, Decl(neverTypeErrors1.ts, 13, 1))

    return 1;
}

function f4(): never {
>f4 : Symbol(f4, Decl(neverTypeErrors1.ts, 17, 1))
}

for (const n of f4()) {}
>n : Symbol(n, Decl(neverTypeErrors1.ts, 22, 10))
>f4 : Symbol(f4, Decl(neverTypeErrors1.ts, 17, 1))

for (const n in f4()) {}
>n : Symbol(n, Decl(neverTypeErrors1.ts, 23, 10))
>f4 : Symbol(f4, Decl(neverTypeErrors1.ts, 17, 1))

function f5() {
>f5 : Symbol(f5, Decl(neverTypeErrors1.ts, 23, 24))

    let x: never[] = [];  // Ok
>x : Symbol(x, Decl(neverTypeErrors1.ts, 26, 7))
}

// Repro from #46032

interface A {
>A : Symbol(A, Decl(neverTypeErrors1.ts, 27, 1))

    foo: "a";
>foo : Symbol(A.foo, Decl(neverTypeErrors1.ts, 31, 13))
}

interface B {
>B : Symbol(B, Decl(neverTypeErrors1.ts, 33, 1))

    foo: "b";
>foo : Symbol(B.foo, Decl(neverTypeErrors1.ts, 35, 13))
}

type Union = A & B;
>Union : Symbol(Union, Decl(neverTypeErrors1.ts, 37, 1))
>A : Symbol(A, Decl(neverTypeErrors1.ts, 27, 1))
>B : Symbol(B, Decl(neverTypeErrors1.ts, 33, 1))

function func(): { value: Union[] } {
>func : Symbol(func, Decl(neverTypeErrors1.ts, 39, 19))
>value : Symbol(value, Decl(neverTypeErrors1.ts, 41, 18))
>Union : Symbol(Union, Decl(neverTypeErrors1.ts, 37, 1))

    return {
        value: [],
>value : Symbol(value, Decl(neverTypeErrors1.ts, 42, 12))

    };
}