File: nestedExcessPropertyChecking.symbols

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (115 lines) | stat: -rw-r--r-- 5,274 bytes parent folder | download
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
=== tests/cases/compiler/nestedExcessPropertyChecking.ts ===
type A1 = { x: { a?: string } };
>A1 : Symbol(A1, Decl(nestedExcessPropertyChecking.ts, 0, 0))
>x : Symbol(x, Decl(nestedExcessPropertyChecking.ts, 0, 11))
>a : Symbol(a, Decl(nestedExcessPropertyChecking.ts, 0, 16))

type B1 = { x: { b?: string } };
>B1 : Symbol(B1, Decl(nestedExcessPropertyChecking.ts, 0, 32))
>x : Symbol(x, Decl(nestedExcessPropertyChecking.ts, 1, 11))
>b : Symbol(b, Decl(nestedExcessPropertyChecking.ts, 1, 16))

type C1 = { x: { c: string } };
>C1 : Symbol(C1, Decl(nestedExcessPropertyChecking.ts, 1, 32))
>x : Symbol(x, Decl(nestedExcessPropertyChecking.ts, 3, 11))
>c : Symbol(c, Decl(nestedExcessPropertyChecking.ts, 3, 16))

const ab1: A1 & B1 = {} as C1;  // Error
>ab1 : Symbol(ab1, Decl(nestedExcessPropertyChecking.ts, 5, 5))
>A1 : Symbol(A1, Decl(nestedExcessPropertyChecking.ts, 0, 0))
>B1 : Symbol(B1, Decl(nestedExcessPropertyChecking.ts, 0, 32))
>C1 : Symbol(C1, Decl(nestedExcessPropertyChecking.ts, 1, 32))

type A2 = { a?: string };
>A2 : Symbol(A2, Decl(nestedExcessPropertyChecking.ts, 5, 30))
>a : Symbol(a, Decl(nestedExcessPropertyChecking.ts, 7, 11))

type B2 = { b?: string };
>B2 : Symbol(B2, Decl(nestedExcessPropertyChecking.ts, 7, 25))
>b : Symbol(b, Decl(nestedExcessPropertyChecking.ts, 8, 11))

type C2 = { c: string };
>C2 : Symbol(C2, Decl(nestedExcessPropertyChecking.ts, 8, 25))
>c : Symbol(c, Decl(nestedExcessPropertyChecking.ts, 10, 11))

const ab2: A2 & B2 = {} as C2;  // Error
>ab2 : Symbol(ab2, Decl(nestedExcessPropertyChecking.ts, 12, 5))
>A2 : Symbol(A2, Decl(nestedExcessPropertyChecking.ts, 5, 30))
>B2 : Symbol(B2, Decl(nestedExcessPropertyChecking.ts, 7, 25))
>C2 : Symbol(C2, Decl(nestedExcessPropertyChecking.ts, 8, 25))

enum E { A = "A" }
>E : Symbol(E, Decl(nestedExcessPropertyChecking.ts, 12, 30))
>A : Symbol(E.A, Decl(nestedExcessPropertyChecking.ts, 14, 8))

let x: { nope?: any } = E.A;  // Error
>x : Symbol(x, Decl(nestedExcessPropertyChecking.ts, 16, 3))
>nope : Symbol(nope, Decl(nestedExcessPropertyChecking.ts, 16, 8))
>E.A : Symbol(E.A, Decl(nestedExcessPropertyChecking.ts, 14, 8))
>E : Symbol(E, Decl(nestedExcessPropertyChecking.ts, 12, 30))
>A : Symbol(E.A, Decl(nestedExcessPropertyChecking.ts, 14, 8))

let y: { nope?: any } = "A";  // Error
>y : Symbol(y, Decl(nestedExcessPropertyChecking.ts, 17, 3))
>nope : Symbol(nope, Decl(nestedExcessPropertyChecking.ts, 17, 8))

// Repros from #51043

type OverridesInput = {
>OverridesInput : Symbol(OverridesInput, Decl(nestedExcessPropertyChecking.ts, 17, 28))

    someProp?: 'A' | 'B'
>someProp : Symbol(someProp, Decl(nestedExcessPropertyChecking.ts, 21, 23))
}

const foo1: Partial<{ something: any }> & { variables: {
>foo1 : Symbol(foo1, Decl(nestedExcessPropertyChecking.ts, 25, 5))
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
>something : Symbol(something, Decl(nestedExcessPropertyChecking.ts, 25, 21))
>variables : Symbol(variables, Decl(nestedExcessPropertyChecking.ts, 25, 43))

    overrides?: OverridesInput;
>overrides : Symbol(overrides, Decl(nestedExcessPropertyChecking.ts, 25, 56))
>OverridesInput : Symbol(OverridesInput, Decl(nestedExcessPropertyChecking.ts, 17, 28))

} & Partial<{
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))

    overrides?: OverridesInput;
>overrides : Symbol(overrides, Decl(nestedExcessPropertyChecking.ts, 27, 13))
>OverridesInput : Symbol(OverridesInput, Decl(nestedExcessPropertyChecking.ts, 17, 28))

}>} = { variables: { overrides: false } };  // Error
>variables : Symbol(variables, Decl(nestedExcessPropertyChecking.ts, 29, 7))
>overrides : Symbol(overrides, Decl(nestedExcessPropertyChecking.ts, 29, 20))


interface Unrelated { _?: any }
>Unrelated : Symbol(Unrelated, Decl(nestedExcessPropertyChecking.ts, 29, 42))
>_ : Symbol(Unrelated._, Decl(nestedExcessPropertyChecking.ts, 32, 21))

interface VariablesA { overrides?: OverridesInput; }
>VariablesA : Symbol(VariablesA, Decl(nestedExcessPropertyChecking.ts, 32, 31))
>overrides : Symbol(VariablesA.overrides, Decl(nestedExcessPropertyChecking.ts, 34, 22))
>OverridesInput : Symbol(OverridesInput, Decl(nestedExcessPropertyChecking.ts, 17, 28))

interface VariablesB { overrides?: OverridesInput; }
>VariablesB : Symbol(VariablesB, Decl(nestedExcessPropertyChecking.ts, 34, 52))
>overrides : Symbol(VariablesB.overrides, Decl(nestedExcessPropertyChecking.ts, 35, 22))
>OverridesInput : Symbol(OverridesInput, Decl(nestedExcessPropertyChecking.ts, 17, 28))

const foo2: Unrelated & { variables: VariablesA & VariablesB } = {
>foo2 : Symbol(foo2, Decl(nestedExcessPropertyChecking.ts, 37, 5))
>Unrelated : Symbol(Unrelated, Decl(nestedExcessPropertyChecking.ts, 29, 42))
>variables : Symbol(variables, Decl(nestedExcessPropertyChecking.ts, 37, 25))
>VariablesA : Symbol(VariablesA, Decl(nestedExcessPropertyChecking.ts, 32, 31))
>VariablesB : Symbol(VariablesB, Decl(nestedExcessPropertyChecking.ts, 34, 52))

    variables: {
>variables : Symbol(variables, Decl(nestedExcessPropertyChecking.ts, 37, 66))

        overrides: false  // Error
>overrides : Symbol(overrides, Decl(nestedExcessPropertyChecking.ts, 38, 16))
    }
};