File: declarationEmitStringEnumUsedInNonlocalSpread.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (80 lines) | stat: -rw-r--r-- 1,837 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
=== tests/cases/compiler/class.ts ===
export const enum TestEnum {
>TestEnum : TestEnum

    Test1 = '123123',
>Test1 : TestEnum.Test1
>'123123' : "123123"

    Test2 = '12312312312',
>Test2 : TestEnum.Test2
>'12312312312' : "12312312312"
}

export interface ITest {
    [TestEnum.Test1]: string;
>[TestEnum.Test1] : string
>TestEnum.Test1 : TestEnum.Test1
>TestEnum : typeof TestEnum
>Test1 : TestEnum.Test1

    [TestEnum.Test2]: string;
>[TestEnum.Test2] : string
>TestEnum.Test2 : TestEnum.Test2
>TestEnum : typeof TestEnum
>Test2 : TestEnum.Test2
}

export class A {
>A : A

    getA(): ITest {
>getA : () => ITest

        return {
>{            [TestEnum.Test1]: '123',            [TestEnum.Test2]: '123',        } : { 123123: string; 12312312312: string; }

            [TestEnum.Test1]: '123',
>[TestEnum.Test1] : string
>TestEnum.Test1 : TestEnum.Test1
>TestEnum : typeof TestEnum
>Test1 : TestEnum.Test1
>'123' : "123"

            [TestEnum.Test2]: '123',
>[TestEnum.Test2] : string
>TestEnum.Test2 : TestEnum.Test2
>TestEnum : typeof TestEnum
>Test2 : TestEnum.Test2
>'123' : "123"

        };
    }
}
=== tests/cases/compiler/index.ts ===
import { A } from './class';
>A : typeof A

export class B extends A {
>B : B
>A : A

    getA() { // TS4053 error
>getA : () => { a: string; 123123: string; 12312312312: string; }

        return {
>{            ...super.getA(),            a: '123',        } : { a: string; 123123: string; 12312312312: string; }

            ...super.getA(),
>super.getA() : import("tests/cases/compiler/class").ITest
>super.getA : () => import("tests/cases/compiler/class").ITest
>super : A
>getA : () => import("tests/cases/compiler/class").ITest

            a: '123',
>a : string
>'123' : "123"

        };
    }
}