2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyAccess.ts ===
|
|
|
|
class C {
|
|
|
|
>C : C
|
|
|
|
|
|
|
|
"a b": number;
|
|
|
|
static "c d": number;
|
|
|
|
}
|
|
|
|
var c: C;
|
|
|
|
>c : C
|
|
|
|
>C : C
|
|
|
|
|
|
|
|
var r1 = c["a b"];
|
|
|
|
>r1 : number
|
|
|
|
>c["a b"] : number
|
|
|
|
>c : C
|
|
|
|
|
|
|
|
var r1b = C['c d'];
|
|
|
|
>r1b : number
|
|
|
|
>C['c d'] : number
|
|
|
|
>C : typeof C
|
|
|
|
|
|
|
|
interface I {
|
|
|
|
>I : I
|
|
|
|
|
|
|
|
"a b": number;
|
|
|
|
}
|
|
|
|
var i: I;
|
|
|
|
>i : I
|
|
|
|
>I : I
|
|
|
|
|
|
|
|
var r2 = i["a b"];
|
|
|
|
>r2 : number
|
|
|
|
>i["a b"] : number
|
|
|
|
>i : I
|
|
|
|
|
|
|
|
var a: {
|
|
|
|
>a : { "a b": number; }
|
|
|
|
|
|
|
|
"a b": number;
|
|
|
|
}
|
|
|
|
var r3 = a["a b"];
|
|
|
|
>r3 : number
|
|
|
|
>a["a b"] : number
|
|
|
|
>a : { "a b": number; }
|
|
|
|
|
|
|
|
var b = {
|
|
|
|
>b : { "a b": number; }
|
2014-08-22 03:39:46 +02:00
|
|
|
>{ "a b": 1} : { "a b": number; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
"a b": 1
|
|
|
|
}
|
|
|
|
var r4 = b["a b"];
|
|
|
|
>r4 : number
|
|
|
|
>b["a b"] : number
|
|
|
|
>b : { "a b": number; }
|
|
|
|
|