119 lines
1.7 KiB
Text
119 lines
1.7 KiB
Text
=== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexingResults.ts ===
|
|
class C {
|
|
>C : C
|
|
|
|
[x: string]: string;
|
|
>x : string
|
|
|
|
y = '';
|
|
>y : string
|
|
>'' : string
|
|
}
|
|
|
|
var c: C;
|
|
>c : C
|
|
>C : C
|
|
|
|
var r1 = c['y'];
|
|
>r1 : string
|
|
>c['y'] : string
|
|
>c : C
|
|
>'y' : string
|
|
|
|
var r2 = c['a'];
|
|
>r2 : string
|
|
>c['a'] : string
|
|
>c : C
|
|
>'a' : string
|
|
|
|
var r3 = c[1];
|
|
>r3 : string
|
|
>c[1] : string
|
|
>c : C
|
|
>1 : number
|
|
|
|
interface I {
|
|
>I : I
|
|
|
|
[x: string]: string;
|
|
>x : string
|
|
|
|
y: string;
|
|
>y : string
|
|
}
|
|
|
|
var i: I
|
|
>i : I
|
|
>I : I
|
|
|
|
var r4 = i['y'];
|
|
>r4 : string
|
|
>i['y'] : string
|
|
>i : I
|
|
>'y' : string
|
|
|
|
var r5 = i['a'];
|
|
>r5 : string
|
|
>i['a'] : string
|
|
>i : I
|
|
>'a' : string
|
|
|
|
var r6 = i[1];
|
|
>r6 : string
|
|
>i[1] : string
|
|
>i : I
|
|
>1 : number
|
|
|
|
var a: {
|
|
>a : { [x: string]: string; y: string; }
|
|
|
|
[x: string]: string;
|
|
>x : string
|
|
|
|
y: string;
|
|
>y : string
|
|
}
|
|
|
|
var r7 = a['y'];
|
|
>r7 : string
|
|
>a['y'] : string
|
|
>a : { [x: string]: string; y: string; }
|
|
>'y' : string
|
|
|
|
var r8 = a['a'];
|
|
>r8 : string
|
|
>a['a'] : string
|
|
>a : { [x: string]: string; y: string; }
|
|
>'a' : string
|
|
|
|
var r9 = a[1];
|
|
>r9 : string
|
|
>a[1] : string
|
|
>a : { [x: string]: string; y: string; }
|
|
>1 : number
|
|
|
|
var b: { [x: string]: string } = { y: '' }
|
|
>b : { [x: string]: string; }
|
|
>x : string
|
|
>{ y: '' } : { [x: string]: string; y: string; }
|
|
>y : string
|
|
>'' : string
|
|
|
|
var r10 = b['y'];
|
|
>r10 : string
|
|
>b['y'] : string
|
|
>b : { [x: string]: string; }
|
|
>'y' : string
|
|
|
|
var r11 = b['a'];
|
|
>r11 : string
|
|
>b['a'] : string
|
|
>b : { [x: string]: string; }
|
|
>'a' : string
|
|
|
|
var r12 = b[1];
|
|
>r12 : string
|
|
>b[1] : string
|
|
>b : { [x: string]: string; }
|
|
>1 : number
|
|
|