File: typesWithPrivateConstructor.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 (34 lines) | stat: -rw-r--r-- 1,194 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
=== tests/cases/conformance/types/members/typesWithPrivateConstructor.ts ===
class C {
>C : Symbol(C, Decl(typesWithPrivateConstructor.ts, 0, 0))

    private constructor() { }
}

var c = new C(); // error C is private
>c : Symbol(c, Decl(typesWithPrivateConstructor.ts, 4, 3))
>C : Symbol(C, Decl(typesWithPrivateConstructor.ts, 0, 0))

var r: () => void = c.constructor;
>r : Symbol(r, Decl(typesWithPrivateConstructor.ts, 5, 3))
>c : Symbol(c, Decl(typesWithPrivateConstructor.ts, 4, 3))

class C2 {
>C2 : Symbol(C2, Decl(typesWithPrivateConstructor.ts, 5, 34))

    private constructor(x: number);
>x : Symbol(x, Decl(typesWithPrivateConstructor.ts, 8, 24))

    private constructor(x: any) { }
>x : Symbol(x, Decl(typesWithPrivateConstructor.ts, 9, 24))
}

var c2 = new C2(); // error C2 is private
>c2 : Symbol(c2, Decl(typesWithPrivateConstructor.ts, 12, 3))
>C2 : Symbol(C2, Decl(typesWithPrivateConstructor.ts, 5, 34))

var r2: (x: number) => void = c2.constructor;
>r2 : Symbol(r2, Decl(typesWithPrivateConstructor.ts, 13, 3))
>x : Symbol(x, Decl(typesWithPrivateConstructor.ts, 13, 9))
>c2 : Symbol(c2, Decl(typesWithPrivateConstructor.ts, 12, 3))