File: staticIndexSignature3.types

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (86 lines) | stat: -rw-r--r-- 1,187 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
=== tests/cases/conformance/classes/staticIndexSignature/staticIndexSignature3.ts ===
class B {
>B : B

    static readonly [s: string]: number;
>s : string

    static readonly [s: number]: 42 | 233
>s : number
}

class D extends B {
>D : D
>B : B

    static readonly [s: string]: number
>s : string
}

class ED extends D {
>ED : ED
>D : D

    static readonly [s: string]: boolean
>s : string

    static readonly [s: number]: 1 
>s : number
}

class DD extends D {
>DD : DD
>D : D

    static readonly [s: string]: 421
>s : string
}

const a = B["f"];
>a : number
>B["f"] : number
>B : typeof B
>"f" : "f"

const b =  B[42];
>b : 42 | 233
>B[42] : 42 | 233
>B : typeof B
>42 : 42

const c = D["f"]
>c : number
>D["f"] : number
>D : typeof D
>"f" : "f"

const d = D[42]
>d : number
>D[42] : number
>D : typeof D
>42 : 42

const e = ED["f"]
>e : boolean
>ED["f"] : boolean
>ED : typeof ED
>"f" : "f"

const f = ED[42]
>f : 1
>ED[42] : 1
>ED : typeof ED
>42 : 42

const g = DD["f"]
>g : 421
>DD["f"] : 421
>DD : typeof DD
>"f" : "f"

const h = DD[42]
>h : 421
>DD[42] : 421
>DD : typeof DD
>42 : 42