53 lines
3 KiB
Text
53 lines
3 KiB
Text
=== 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(a, Decl(propertyNamesWithStringLiteral.ts, 0, 14))
|
|
>r : Symbol(r, Decl(propertyNamesWithStringLiteral.ts, 1, 14))
|
|
>g : Symbol(g, Decl(propertyNamesWithStringLiteral.ts, 1, 25))
|
|
>b : Symbol(b, Decl(propertyNamesWithStringLiteral.ts, 1, 36))
|
|
}
|
|
|
|
interface NamedColors {
|
|
>NamedColors : Symbol(NamedColors, Decl(propertyNamesWithStringLiteral.ts, 2, 1))
|
|
|
|
azure: _Color;
|
|
>azure : Symbol(azure, Decl(propertyNamesWithStringLiteral.ts, 4, 23))
|
|
>_Color : Symbol(_Color, Decl(propertyNamesWithStringLiteral.ts, 0, 0))
|
|
|
|
"blue": _Color;
|
|
>_Color : Symbol(_Color, Decl(propertyNamesWithStringLiteral.ts, 0, 0))
|
|
|
|
"pale blue": _Color;
|
|
>_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))
|
|
|