1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
=== tests/cases/compiler/propertyNamesWithStringLiteral.ts ===
class _Color {
>_Color : Symbol(_Color, Decl(propertyNamesWithStringLiteral.ts, 0, 0))
a: number; r: number; g: number; b: number;
>a : Symbol(_Color.a, Decl(propertyNamesWithStringLiteral.ts, 0, 14))
>r : Symbol(_Color.r, Decl(propertyNamesWithStringLiteral.ts, 1, 14))
>g : Symbol(_Color.g, Decl(propertyNamesWithStringLiteral.ts, 1, 25))
>b : Symbol(_Color.b, Decl(propertyNamesWithStringLiteral.ts, 1, 36))
}
interface NamedColors {
>NamedColors : Symbol(NamedColors, Decl(propertyNamesWithStringLiteral.ts, 2, 1))
azure: _Color;
>azure : Symbol(NamedColors.azure, Decl(propertyNamesWithStringLiteral.ts, 4, 23))
>_Color : Symbol(_Color, Decl(propertyNamesWithStringLiteral.ts, 0, 0))
"blue": _Color;
>"blue" : Symbol(NamedColors["blue"], Decl(propertyNamesWithStringLiteral.ts, 5, 18))
>_Color : Symbol(_Color, Decl(propertyNamesWithStringLiteral.ts, 0, 0))
"pale blue": _Color;
>"pale blue" : Symbol(NamedColors["pale blue"], Decl(propertyNamesWithStringLiteral.ts, 6, 19))
>_Color : Symbol(_Color, Decl(propertyNamesWithStringLiteral.ts, 0, 0))
}
module Color {
>Color : Symbol(Color, Decl(propertyNamesWithStringLiteral.ts, 8, 1))
export var namedColors: NamedColors;
>namedColors : Symbol(namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>NamedColors : Symbol(NamedColors, Decl(propertyNamesWithStringLiteral.ts, 2, 1))
}
var a = Color.namedColors["azure"];
>a : Symbol(a, Decl(propertyNamesWithStringLiteral.ts, 12, 3), Decl(propertyNamesWithStringLiteral.ts, 13, 3), Decl(propertyNamesWithStringLiteral.ts, 14, 3))
>Color.namedColors : Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>Color : Symbol(Color, Decl(propertyNamesWithStringLiteral.ts, 8, 1))
>namedColors : Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>"azure" : Symbol(NamedColors.azure, Decl(propertyNamesWithStringLiteral.ts, 4, 23))
var a = Color.namedColors.blue; // Should not error
>a : Symbol(a, Decl(propertyNamesWithStringLiteral.ts, 12, 3), Decl(propertyNamesWithStringLiteral.ts, 13, 3), Decl(propertyNamesWithStringLiteral.ts, 14, 3))
>Color.namedColors.blue : Symbol(NamedColors["blue"], Decl(propertyNamesWithStringLiteral.ts, 5, 18))
>Color.namedColors : Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>Color : Symbol(Color, Decl(propertyNamesWithStringLiteral.ts, 8, 1))
>namedColors : Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>blue : Symbol(NamedColors["blue"], Decl(propertyNamesWithStringLiteral.ts, 5, 18))
var a = Color.namedColors["pale blue"]; // should not error
>a : Symbol(a, Decl(propertyNamesWithStringLiteral.ts, 12, 3), Decl(propertyNamesWithStringLiteral.ts, 13, 3), Decl(propertyNamesWithStringLiteral.ts, 14, 3))
>Color.namedColors : Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>Color : Symbol(Color, Decl(propertyNamesWithStringLiteral.ts, 8, 1))
>namedColors : Symbol(Color.namedColors, Decl(propertyNamesWithStringLiteral.ts, 10, 14))
>"pale blue" : Symbol(NamedColors["pale blue"], Decl(propertyNamesWithStringLiteral.ts, 6, 19))
|