TypeScript/tests/baselines/reference/stringIndexingResults.types

120 lines
3.8 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexingResults.ts ===
class C {
2015-04-13 23:01:57 +02:00
>C : C, Symbol(C, Decl(stringIndexingResults.ts, 0, 0))
2014-08-15 23:33:16 +02:00
[x: string]: string;
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(stringIndexingResults.ts, 1, 5))
2014-08-15 23:33:16 +02:00
y = '';
2015-04-13 23:01:57 +02:00
>y : string, Symbol(y, Decl(stringIndexingResults.ts, 1, 24))
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
}
var c: C;
2015-04-13 23:01:57 +02:00
>c : C, Symbol(c, Decl(stringIndexingResults.ts, 5, 3))
>C : C, Symbol(C, Decl(stringIndexingResults.ts, 0, 0))
2014-08-15 23:33:16 +02:00
var r1 = c['y'];
2015-04-13 23:01:57 +02:00
>r1 : string, Symbol(r1, Decl(stringIndexingResults.ts, 6, 3))
2014-08-15 23:33:16 +02:00
>c['y'] : string
2015-04-13 23:01:57 +02:00
>c : C, Symbol(c, Decl(stringIndexingResults.ts, 5, 3))
>'y' : string, Symbol(C.y, Decl(stringIndexingResults.ts, 1, 24))
2014-08-15 23:33:16 +02:00
var r2 = c['a'];
2015-04-13 23:01:57 +02:00
>r2 : string, Symbol(r2, Decl(stringIndexingResults.ts, 7, 3))
2014-08-15 23:33:16 +02:00
>c['a'] : string
2015-04-13 23:01:57 +02:00
>c : C, Symbol(c, Decl(stringIndexingResults.ts, 5, 3))
2015-04-13 21:36:11 +02:00
>'a' : string
2014-08-15 23:33:16 +02:00
var r3 = c[1];
2015-04-13 23:01:57 +02:00
>r3 : string, Symbol(r3, Decl(stringIndexingResults.ts, 8, 3))
2014-08-15 23:33:16 +02:00
>c[1] : string
2015-04-13 23:01:57 +02:00
>c : C, Symbol(c, Decl(stringIndexingResults.ts, 5, 3))
2015-04-13 21:36:11 +02:00
>1 : number
2014-08-15 23:33:16 +02:00
interface I {
2015-04-13 23:01:57 +02:00
>I : I, Symbol(I, Decl(stringIndexingResults.ts, 8, 14))
2014-08-15 23:33:16 +02:00
[x: string]: string;
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(stringIndexingResults.ts, 11, 5))
2014-08-15 23:33:16 +02:00
y: string;
2015-04-13 23:01:57 +02:00
>y : string, Symbol(y, Decl(stringIndexingResults.ts, 11, 24))
2014-08-15 23:33:16 +02:00
}
var i: I
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(stringIndexingResults.ts, 15, 3))
>I : I, Symbol(I, Decl(stringIndexingResults.ts, 8, 14))
2014-08-15 23:33:16 +02:00
var r4 = i['y'];
2015-04-13 23:01:57 +02:00
>r4 : string, Symbol(r4, Decl(stringIndexingResults.ts, 16, 3))
2014-08-15 23:33:16 +02:00
>i['y'] : string
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(stringIndexingResults.ts, 15, 3))
>'y' : string, Symbol(I.y, Decl(stringIndexingResults.ts, 11, 24))
2014-08-15 23:33:16 +02:00
var r5 = i['a'];
2015-04-13 23:01:57 +02:00
>r5 : string, Symbol(r5, Decl(stringIndexingResults.ts, 17, 3))
2014-08-15 23:33:16 +02:00
>i['a'] : string
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(stringIndexingResults.ts, 15, 3))
2015-04-13 21:36:11 +02:00
>'a' : string
2014-08-15 23:33:16 +02:00
var r6 = i[1];
2015-04-13 23:01:57 +02:00
>r6 : string, Symbol(r6, Decl(stringIndexingResults.ts, 18, 3))
2014-08-15 23:33:16 +02:00
>i[1] : string
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(stringIndexingResults.ts, 15, 3))
2015-04-13 21:36:11 +02:00
>1 : number
2014-08-15 23:33:16 +02:00
var a: {
2015-04-13 23:01:57 +02:00
>a : { [x: string]: string; y: string; }, Symbol(a, Decl(stringIndexingResults.ts, 20, 3))
2014-08-15 23:33:16 +02:00
[x: string]: string;
2015-04-13 23:01:57 +02:00
>x : string, Symbol(x, Decl(stringIndexingResults.ts, 21, 5))
2014-08-15 23:33:16 +02:00
y: string;
2015-04-13 23:01:57 +02:00
>y : string, Symbol(y, Decl(stringIndexingResults.ts, 21, 24))
2014-08-15 23:33:16 +02:00
}
var r7 = a['y'];
2015-04-13 23:01:57 +02:00
>r7 : string, Symbol(r7, Decl(stringIndexingResults.ts, 25, 3))
2014-08-15 23:33:16 +02:00
>a['y'] : string
2015-04-13 23:01:57 +02:00
>a : { [x: string]: string; y: string; }, Symbol(a, Decl(stringIndexingResults.ts, 20, 3))
>'y' : string, Symbol(y, Decl(stringIndexingResults.ts, 21, 24))
2014-08-15 23:33:16 +02:00
var r8 = a['a'];
2015-04-13 23:01:57 +02:00
>r8 : string, Symbol(r8, Decl(stringIndexingResults.ts, 26, 3))
2014-08-15 23:33:16 +02:00
>a['a'] : string
2015-04-13 23:01:57 +02:00
>a : { [x: string]: string; y: string; }, Symbol(a, Decl(stringIndexingResults.ts, 20, 3))
2015-04-13 21:36:11 +02:00
>'a' : string
2014-08-15 23:33:16 +02:00
var r9 = a[1];
2015-04-13 23:01:57 +02:00
>r9 : string, Symbol(r9, Decl(stringIndexingResults.ts, 27, 3))
2014-08-15 23:33:16 +02:00
>a[1] : string
2015-04-13 23:01:57 +02:00
>a : { [x: string]: string; y: string; }, Symbol(a, Decl(stringIndexingResults.ts, 20, 3))
2015-04-13 21:36:11 +02:00
>1 : number
2014-08-15 23:33:16 +02:00
var b: { [x: string]: string } = { y: '' }
2015-04-13 23:01:57 +02:00
>b : { [x: string]: string; }, Symbol(b, Decl(stringIndexingResults.ts, 29, 3))
>x : string, Symbol(x, Decl(stringIndexingResults.ts, 29, 10))
2014-08-15 23:33:16 +02:00
>{ y: '' } : { [x: string]: string; y: string; }
2015-04-13 23:01:57 +02:00
>y : string, Symbol(y, Decl(stringIndexingResults.ts, 29, 34))
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
var r10 = b['y'];
2015-04-13 23:01:57 +02:00
>r10 : string, Symbol(r10, Decl(stringIndexingResults.ts, 31, 3))
2014-08-15 23:33:16 +02:00
>b['y'] : string
2015-04-13 23:01:57 +02:00
>b : { [x: string]: string; }, Symbol(b, Decl(stringIndexingResults.ts, 29, 3))
2015-04-13 21:36:11 +02:00
>'y' : string
2014-08-15 23:33:16 +02:00
var r11 = b['a'];
2015-04-13 23:01:57 +02:00
>r11 : string, Symbol(r11, Decl(stringIndexingResults.ts, 32, 3))
2014-08-15 23:33:16 +02:00
>b['a'] : string
2015-04-13 23:01:57 +02:00
>b : { [x: string]: string; }, Symbol(b, Decl(stringIndexingResults.ts, 29, 3))
2015-04-13 21:36:11 +02:00
>'a' : string
2014-08-15 23:33:16 +02:00
var r12 = b[1];
2015-04-13 23:01:57 +02:00
>r12 : string, Symbol(r12, Decl(stringIndexingResults.ts, 33, 3))
2014-08-15 23:33:16 +02:00
>b[1] : string
2015-04-13 23:01:57 +02:00
>b : { [x: string]: string; }, Symbol(b, Decl(stringIndexingResults.ts, 29, 3))
2015-04-13 21:36:11 +02:00
>1 : number
2014-08-15 23:33:16 +02:00