83 lines
3.2 KiB
Text
83 lines
3.2 KiB
Text
=== tests/cases/compiler/constIndexedAccess.ts ===
|
|
|
|
const enum numbers {
|
|
>numbers : Symbol(numbers, Decl(constIndexedAccess.ts, 0, 0))
|
|
|
|
zero,
|
|
>zero : Symbol(numbers.zero, Decl(constIndexedAccess.ts, 1, 20))
|
|
|
|
one
|
|
>one : Symbol(numbers.one, Decl(constIndexedAccess.ts, 2, 9))
|
|
}
|
|
|
|
interface indexAccess {
|
|
>indexAccess : Symbol(indexAccess, Decl(constIndexedAccess.ts, 4, 1))
|
|
|
|
0: string;
|
|
1: number;
|
|
}
|
|
|
|
let test: indexAccess;
|
|
>test : Symbol(test, Decl(constIndexedAccess.ts, 11, 3))
|
|
>indexAccess : Symbol(indexAccess, Decl(constIndexedAccess.ts, 4, 1))
|
|
|
|
let s = test[0];
|
|
>s : Symbol(s, Decl(constIndexedAccess.ts, 13, 3))
|
|
>test : Symbol(test, Decl(constIndexedAccess.ts, 11, 3))
|
|
>0 : Symbol(indexAccess[0], Decl(constIndexedAccess.ts, 6, 23))
|
|
|
|
let n = test[1];
|
|
>n : Symbol(n, Decl(constIndexedAccess.ts, 14, 3))
|
|
>test : Symbol(test, Decl(constIndexedAccess.ts, 11, 3))
|
|
>1 : Symbol(indexAccess[1], Decl(constIndexedAccess.ts, 7, 14))
|
|
|
|
let s1 = test[numbers.zero];
|
|
>s1 : Symbol(s1, Decl(constIndexedAccess.ts, 16, 3))
|
|
>test : Symbol(test, Decl(constIndexedAccess.ts, 11, 3))
|
|
>numbers.zero : Symbol(numbers.zero, Decl(constIndexedAccess.ts, 1, 20))
|
|
>numbers : Symbol(numbers, Decl(constIndexedAccess.ts, 0, 0))
|
|
>zero : Symbol(numbers.zero, Decl(constIndexedAccess.ts, 1, 20))
|
|
|
|
let n1 = test[numbers.one];
|
|
>n1 : Symbol(n1, Decl(constIndexedAccess.ts, 17, 3))
|
|
>test : Symbol(test, Decl(constIndexedAccess.ts, 11, 3))
|
|
>numbers.one : Symbol(numbers.one, Decl(constIndexedAccess.ts, 2, 9))
|
|
>numbers : Symbol(numbers, Decl(constIndexedAccess.ts, 0, 0))
|
|
>one : Symbol(numbers.one, Decl(constIndexedAccess.ts, 2, 9))
|
|
|
|
let s2 = test[numbers["zero"]];
|
|
>s2 : Symbol(s2, Decl(constIndexedAccess.ts, 19, 3))
|
|
>test : Symbol(test, Decl(constIndexedAccess.ts, 11, 3))
|
|
>numbers : Symbol(numbers, Decl(constIndexedAccess.ts, 0, 0))
|
|
>"zero" : Symbol(numbers.zero, Decl(constIndexedAccess.ts, 1, 20))
|
|
|
|
let n2 = test[numbers["one"]];
|
|
>n2 : Symbol(n2, Decl(constIndexedAccess.ts, 20, 3))
|
|
>test : Symbol(test, Decl(constIndexedAccess.ts, 11, 3))
|
|
>numbers : Symbol(numbers, Decl(constIndexedAccess.ts, 0, 0))
|
|
>"one" : Symbol(numbers.one, Decl(constIndexedAccess.ts, 2, 9))
|
|
|
|
enum numbersNotConst {
|
|
>numbersNotConst : Symbol(numbersNotConst, Decl(constIndexedAccess.ts, 20, 30))
|
|
|
|
zero,
|
|
>zero : Symbol(numbersNotConst.zero, Decl(constIndexedAccess.ts, 22, 22))
|
|
|
|
one
|
|
>one : Symbol(numbersNotConst.one, Decl(constIndexedAccess.ts, 23, 9))
|
|
}
|
|
|
|
let s3 = test[numbersNotConst.zero];
|
|
>s3 : Symbol(s3, Decl(constIndexedAccess.ts, 27, 3))
|
|
>test : Symbol(test, Decl(constIndexedAccess.ts, 11, 3))
|
|
>numbersNotConst.zero : Symbol(numbersNotConst.zero, Decl(constIndexedAccess.ts, 22, 22))
|
|
>numbersNotConst : Symbol(numbersNotConst, Decl(constIndexedAccess.ts, 20, 30))
|
|
>zero : Symbol(numbersNotConst.zero, Decl(constIndexedAccess.ts, 22, 22))
|
|
|
|
let n3 = test[numbersNotConst.one];
|
|
>n3 : Symbol(n3, Decl(constIndexedAccess.ts, 28, 3))
|
|
>test : Symbol(test, Decl(constIndexedAccess.ts, 11, 3))
|
|
>numbersNotConst.one : Symbol(numbersNotConst.one, Decl(constIndexedAccess.ts, 23, 9))
|
|
>numbersNotConst : Symbol(numbersNotConst, Decl(constIndexedAccess.ts, 20, 30))
|
|
>one : Symbol(numbersNotConst.one, Decl(constIndexedAccess.ts, 23, 9))
|
|
|