TypeScript/tests/baselines/reference/propertyNamesWithStringLiteral.types
2015-04-13 14:29:37 -07:00

56 lines
3.3 KiB
Plaintext

=== tests/cases/compiler/propertyNamesWithStringLiteral.ts ===
class _Color {
>_Color : _Color, Symbol(_Color, Decl(propertyNamesWithStringLiteral.ts, 0, 0))
a: number; r: number; g: number; b: number;
>a : number, Symbol(a, Decl(propertyNamesWithStringLiteral.ts, 0, 14))
>r : number, Symbol(r, Decl(propertyNamesWithStringLiteral.ts, 1, 14))
>g : number, Symbol(g, Decl(propertyNamesWithStringLiteral.ts, 1, 25))
>b : number, Symbol(b, Decl(propertyNamesWithStringLiteral.ts, 1, 36))
}
interface NamedColors {
>NamedColors : NamedColors, Symbol(NamedColors, Decl(propertyNamesWithStringLiteral.ts, 2, 1))
azure: _Color;
>azure : _Color, Symbol(azure, Decl(propertyNamesWithStringLiteral.ts, 4, 23))
>_Color : _Color, Symbol(_Color, Decl(propertyNamesWithStringLiteral.ts, 0, 0))
"blue": _Color;
>_Color : _Color, Symbol(_Color, Decl(propertyNamesWithStringLiteral.ts, 0, 0))
"pale blue": _Color;
>_Color : _Color, Symbol(_Color, Decl(propertyNamesWithStringLiteral.ts, 0, 0))
}
module Color {
>Color : typeof Color, Symbol(Color, Decl(propertyNamesWithStringLiteral.ts, 8, 1))
export var namedColors: NamedColors;
>namedColors : NamedColors, Symbol(namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>NamedColors : NamedColors, Symbol(NamedColors, Decl(propertyNamesWithStringLiteral.ts, 2, 1))
}
var a = Color.namedColors["azure"];
>a : _Color, Symbol(a, Decl(propertyNamesWithStringLiteral.ts, 12, 3), Decl(propertyNamesWithStringLiteral.ts, 13, 3), Decl(propertyNamesWithStringLiteral.ts, 14, 3))
>Color.namedColors["azure"] : _Color
>Color.namedColors : NamedColors, Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>Color : typeof Color, Symbol(Color, Decl(propertyNamesWithStringLiteral.ts, 8, 1))
>namedColors : NamedColors, Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>"azure" : string, Symbol(NamedColors.azure, Decl(propertyNamesWithStringLiteral.ts, 4, 23))
var a = Color.namedColors.blue; // Should not error
>a : _Color, Symbol(a, Decl(propertyNamesWithStringLiteral.ts, 12, 3), Decl(propertyNamesWithStringLiteral.ts, 13, 3), Decl(propertyNamesWithStringLiteral.ts, 14, 3))
>Color.namedColors.blue : _Color, Symbol(NamedColors."blue", Decl(propertyNamesWithStringLiteral.ts, 5, 18))
>Color.namedColors : NamedColors, Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>Color : typeof Color, Symbol(Color, Decl(propertyNamesWithStringLiteral.ts, 8, 1))
>namedColors : NamedColors, Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>blue : _Color, Symbol(NamedColors."blue", Decl(propertyNamesWithStringLiteral.ts, 5, 18))
var a = Color.namedColors["pale blue"]; // should not error
>a : _Color, Symbol(a, Decl(propertyNamesWithStringLiteral.ts, 12, 3), Decl(propertyNamesWithStringLiteral.ts, 13, 3), Decl(propertyNamesWithStringLiteral.ts, 14, 3))
>Color.namedColors["pale blue"] : _Color
>Color.namedColors : NamedColors, Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>Color : typeof Color, Symbol(Color, Decl(propertyNamesWithStringLiteral.ts, 8, 1))
>namedColors : NamedColors, Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>"pale blue" : string, Symbol(NamedColors."pale blue", Decl(propertyNamesWithStringLiteral.ts, 6, 19))