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

32 lines
1.3 KiB
Plaintext

=== tests/cases/compiler/enumMapBackIntoItself.ts ===
enum TShirtSize {
>TShirtSize : TShirtSize, Symbol(TShirtSize, Decl(enumMapBackIntoItself.ts, 0, 0))
Small,
>Small : TShirtSize, Symbol(TShirtSize.Small, Decl(enumMapBackIntoItself.ts, 0, 17))
Medium,
>Medium : TShirtSize, Symbol(TShirtSize.Medium, Decl(enumMapBackIntoItself.ts, 1, 9))
Large
>Large : TShirtSize, Symbol(TShirtSize.Large, Decl(enumMapBackIntoItself.ts, 2, 10))
}
var mySize = TShirtSize.Large;
>mySize : TShirtSize, Symbol(mySize, Decl(enumMapBackIntoItself.ts, 5, 3))
>TShirtSize.Large : TShirtSize, Symbol(TShirtSize.Large, Decl(enumMapBackIntoItself.ts, 2, 10))
>TShirtSize : typeof TShirtSize, Symbol(TShirtSize, Decl(enumMapBackIntoItself.ts, 0, 0))
>Large : TShirtSize, Symbol(TShirtSize.Large, Decl(enumMapBackIntoItself.ts, 2, 10))
var test = TShirtSize[mySize];
>test : string, Symbol(test, Decl(enumMapBackIntoItself.ts, 6, 3))
>TShirtSize[mySize] : string
>TShirtSize : typeof TShirtSize, Symbol(TShirtSize, Decl(enumMapBackIntoItself.ts, 0, 0))
>mySize : TShirtSize, Symbol(mySize, Decl(enumMapBackIntoItself.ts, 5, 3))
// specifically checking output here, bug was that test used to be undefined at runtime
test + ''
>test + '' : string
>test : string, Symbol(test, Decl(enumMapBackIntoItself.ts, 6, 3))
>'' : string