TypeScript/tests/baselines/reference/enumMapBackIntoItself.types

32 lines
636 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/enumMapBackIntoItself.ts ===
enum TShirtSize {
>TShirtSize : TShirtSize
2014-08-15 23:33:16 +02:00
Small,
>Small : TShirtSize
2014-08-15 23:33:16 +02:00
Medium,
>Medium : TShirtSize
2014-08-15 23:33:16 +02:00
Large
>Large : TShirtSize
2014-08-15 23:33:16 +02:00
}
var mySize = TShirtSize.Large;
>mySize : TShirtSize
>TShirtSize.Large : TShirtSize
>TShirtSize : typeof TShirtSize
>Large : TShirtSize
2014-08-15 23:33:16 +02:00
var test = TShirtSize[mySize];
>test : string
2014-08-15 23:33:16 +02:00
>TShirtSize[mySize] : string
>TShirtSize : typeof TShirtSize
>mySize : TShirtSize
2014-08-15 23:33:16 +02:00
// specifically checking output here, bug was that test used to be undefined at runtime
test + ''
>test + '' : string
>test : string
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00