File: propertySignatures.symbols

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 (44 lines) | stat: -rw-r--r-- 1,596 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
35
36
37
38
39
40
41
42
43
44
=== tests/cases/compiler/propertySignatures.ts ===
// Should be error - duplicate identifiers
var foo1: { a:string; a: string; };
>foo1 : Symbol(foo1, Decl(propertySignatures.ts, 1, 3))
>a : Symbol(a, Decl(propertySignatures.ts, 1, 11), Decl(propertySignatures.ts, 1, 21))
>a : Symbol(a, Decl(propertySignatures.ts, 1, 11), Decl(propertySignatures.ts, 1, 21))

// Should be OK
var foo2: { a; };
>foo2 : Symbol(foo2, Decl(propertySignatures.ts, 4, 3))
>a : Symbol(a, Decl(propertySignatures.ts, 4, 11))

foo2.a = 2;
>foo2.a : Symbol(a, Decl(propertySignatures.ts, 4, 11))
>foo2 : Symbol(foo2, Decl(propertySignatures.ts, 4, 3))
>a : Symbol(a, Decl(propertySignatures.ts, 4, 11))

foo2.a = "0";
>foo2.a : Symbol(a, Decl(propertySignatures.ts, 4, 11))
>foo2 : Symbol(foo2, Decl(propertySignatures.ts, 4, 3))
>a : Symbol(a, Decl(propertySignatures.ts, 4, 11))

// Should be error
var foo3: { (): string; (): string; };
>foo3 : Symbol(foo3, Decl(propertySignatures.ts, 9, 3))

// Should be OK
var foo4: { (): void; };
>foo4 : Symbol(foo4, Decl(propertySignatures.ts, 12, 3))

var test = foo();
>test : Symbol(test, Decl(propertySignatures.ts, 13, 3), Decl(propertySignatures.ts, 17, 3))

// Should be OK
var foo5: {();};
>foo5 : Symbol(foo5, Decl(propertySignatures.ts, 16, 3))

var test = foo5();
>test : Symbol(test, Decl(propertySignatures.ts, 13, 3), Decl(propertySignatures.ts, 17, 3))
>foo5 : Symbol(foo5, Decl(propertySignatures.ts, 16, 3))

test.bar = 2;
>test : Symbol(test, Decl(propertySignatures.ts, 13, 3), Decl(propertySignatures.ts, 17, 3))