TypeScript/tests/baselines/reference/objectTypeWithNumericProperty.types

140 lines
7.3 KiB
Text
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/types/members/objectTypeWithNumericProperty.ts ===
// no errors here
class C {
2015-04-13 23:01:57 +02:00
>C : C, Symbol(C, Decl(objectTypeWithNumericProperty.ts, 0, 0))
2014-08-15 23:33:16 +02:00
1: number;
1.1: string;
}
var c: C;
2015-04-13 23:01:57 +02:00
>c : C, Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3))
>C : C, Symbol(C, Decl(objectTypeWithNumericProperty.ts, 0, 0))
2014-08-15 23:33:16 +02:00
var r1 = c[1];
2015-04-13 23:01:57 +02:00
>r1 : number, Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3))
2014-08-15 23:33:16 +02:00
>c[1] : number
2015-04-13 23:01:57 +02:00
>c : C, Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3))
>1 : number, Symbol(C.1, Decl(objectTypeWithNumericProperty.ts, 2, 9))
2014-08-15 23:33:16 +02:00
var r2 = c[1.1];
2015-04-13 23:01:57 +02:00
>r2 : string, Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3))
2014-08-15 23:33:16 +02:00
>c[1.1] : string
2015-04-13 23:01:57 +02:00
>c : C, Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3))
>1.1 : number, Symbol(C.1.1, Decl(objectTypeWithNumericProperty.ts, 3, 14))
2014-08-15 23:33:16 +02:00
var r3 = c['1'];
2015-04-13 23:01:57 +02:00
>r3 : number, Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3))
2014-08-15 23:33:16 +02:00
>c['1'] : number
2015-04-13 23:01:57 +02:00
>c : C, Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3))
>'1' : string, Symbol(C.1, Decl(objectTypeWithNumericProperty.ts, 2, 9))
2014-08-15 23:33:16 +02:00
var r4 = c['1.1'];
2015-04-13 23:01:57 +02:00
>r4 : string, Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3))
2014-08-15 23:33:16 +02:00
>c['1.1'] : string
2015-04-13 23:01:57 +02:00
>c : C, Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3))
>'1.1' : string, Symbol(C.1.1, Decl(objectTypeWithNumericProperty.ts, 3, 14))
2014-08-15 23:33:16 +02:00
interface I {
2015-04-13 23:01:57 +02:00
>I : I, Symbol(I, Decl(objectTypeWithNumericProperty.ts, 11, 18))
2014-08-15 23:33:16 +02:00
1: number;
1.1: string;
}
var i: I;
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3))
>I : I, Symbol(I, Decl(objectTypeWithNumericProperty.ts, 11, 18))
2014-08-15 23:33:16 +02:00
var r1 = i[1];
2015-04-13 23:01:57 +02:00
>r1 : number, Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3))
2014-08-15 23:33:16 +02:00
>i[1] : number
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3))
>1 : number, Symbol(I.1, Decl(objectTypeWithNumericProperty.ts, 13, 13))
2014-08-15 23:33:16 +02:00
var r2 = i[1.1];
2015-04-13 23:01:57 +02:00
>r2 : string, Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3))
2014-08-15 23:33:16 +02:00
>i[1.1] : string
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3))
>1.1 : number, Symbol(I.1.1, Decl(objectTypeWithNumericProperty.ts, 14, 14))
2014-08-15 23:33:16 +02:00
var r3 = i['1'];
2015-04-13 23:01:57 +02:00
>r3 : number, Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3))
2014-08-15 23:33:16 +02:00
>i['1'] : number
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3))
>'1' : string, Symbol(I.1, Decl(objectTypeWithNumericProperty.ts, 13, 13))
2014-08-15 23:33:16 +02:00
var r4 = i['1.1'];
2015-04-13 23:01:57 +02:00
>r4 : string, Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3))
2014-08-15 23:33:16 +02:00
>i['1.1'] : string
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3))
>'1.1' : string, Symbol(I.1.1, Decl(objectTypeWithNumericProperty.ts, 14, 14))
2014-08-15 23:33:16 +02:00
var a: {
2015-04-13 23:01:57 +02:00
>a : { 1: number; 1.1: string; }, Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3))
2014-08-15 23:33:16 +02:00
1: number;
1.1: string;
}
var r1 = a[1];
2015-04-13 23:01:57 +02:00
>r1 : number, Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3))
2014-08-15 23:33:16 +02:00
>a[1] : number
2015-04-13 23:01:57 +02:00
>a : { 1: number; 1.1: string; }, Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3))
>1 : number, Symbol(1, Decl(objectTypeWithNumericProperty.ts, 24, 8))
2014-08-15 23:33:16 +02:00
var r2 = a[1.1];
2015-04-13 23:01:57 +02:00
>r2 : string, Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3))
2014-08-15 23:33:16 +02:00
>a[1.1] : string
2015-04-13 23:01:57 +02:00
>a : { 1: number; 1.1: string; }, Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3))
>1.1 : number, Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 25, 14))
2014-08-15 23:33:16 +02:00
var r3 = a['1'];
2015-04-13 23:01:57 +02:00
>r3 : number, Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3))
2014-08-15 23:33:16 +02:00
>a['1'] : number
2015-04-13 23:01:57 +02:00
>a : { 1: number; 1.1: string; }, Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3))
>'1' : string, Symbol(1, Decl(objectTypeWithNumericProperty.ts, 24, 8))
2014-08-15 23:33:16 +02:00
var r4 = a['1.1'];
2015-04-13 23:01:57 +02:00
>r4 : string, Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3))
2014-08-15 23:33:16 +02:00
>a['1.1'] : string
2015-04-13 23:01:57 +02:00
>a : { 1: number; 1.1: string; }, Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3))
>'1.1' : string, Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 25, 14))
2014-08-15 23:33:16 +02:00
var b = {
2015-04-13 23:01:57 +02:00
>b : { 1: number; 1.1: string; }, Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3))
2014-08-22 03:39:46 +02:00
>{ 1: 1, 1.1: ""} : { 1: number; 1.1: string; }
2014-08-15 23:33:16 +02:00
1: 1,
2015-04-13 21:36:11 +02:00
>1 : number
2014-08-15 23:33:16 +02:00
1.1: ""
2015-04-13 21:36:11 +02:00
>"" : string
2014-08-15 23:33:16 +02:00
}
var r1 = b[1];
2015-04-13 23:01:57 +02:00
>r1 : number, Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3))
2014-08-15 23:33:16 +02:00
>b[1] : number
2015-04-13 23:01:57 +02:00
>b : { 1: number; 1.1: string; }, Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3))
>1 : number, Symbol(1, Decl(objectTypeWithNumericProperty.ts, 34, 9))
2014-08-15 23:33:16 +02:00
var r2 = b[1.1];
2015-04-13 23:01:57 +02:00
>r2 : string, Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3))
2014-08-15 23:33:16 +02:00
>b[1.1] : string
2015-04-13 23:01:57 +02:00
>b : { 1: number; 1.1: string; }, Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3))
>1.1 : number, Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 35, 9))
2014-08-15 23:33:16 +02:00
var r3 = b['1'];
2015-04-13 23:01:57 +02:00
>r3 : number, Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3))
2014-08-15 23:33:16 +02:00
>b['1'] : number
2015-04-13 23:01:57 +02:00
>b : { 1: number; 1.1: string; }, Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3))
>'1' : string, Symbol(1, Decl(objectTypeWithNumericProperty.ts, 34, 9))
2014-08-15 23:33:16 +02:00
var r4 = b['1.1'];
2015-04-13 23:01:57 +02:00
>r4 : string, Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3))
2014-08-15 23:33:16 +02:00
>b['1.1'] : string
2015-04-13 23:01:57 +02:00
>b : { 1: number; 1.1: string; }, Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3))
>'1.1' : string, Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 35, 9))
2014-08-15 23:33:16 +02:00