File: hidingIndexSignatures.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 (30 lines) | stat: -rw-r--r-- 888 bytes parent folder | download | duplicates (7)
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
=== tests/cases/compiler/hidingIndexSignatures.ts ===
interface A {
>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0))

    [a: string]: {};
>a : Symbol(a, Decl(hidingIndexSignatures.ts, 1, 5))
}

interface B extends A {
>B : Symbol(B, Decl(hidingIndexSignatures.ts, 2, 1))
>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0))

    [a: string]: number; // Number is not a subtype of string.  Should error.
>a : Symbol(a, Decl(hidingIndexSignatures.ts, 5, 5))
}

var b: B;
>b : Symbol(b, Decl(hidingIndexSignatures.ts, 8, 3))
>B : Symbol(B, Decl(hidingIndexSignatures.ts, 2, 1))

b[""]; // Should be number
>b : Symbol(b, Decl(hidingIndexSignatures.ts, 8, 3))

var a: A;
>a : Symbol(a, Decl(hidingIndexSignatures.ts, 10, 3))
>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0))

a[""]; // Should be {}
>a : Symbol(a, Decl(hidingIndexSignatures.ts, 10, 3))