TypeScript/tests/baselines/reference/enumPropertyAccess.errors.txt
2014-07-12 17:30:19 -07:00

19 lines
520 B
Plaintext

==== tests/cases/compiler/enumPropertyAccess.ts (2 errors) ====
enum Colors {
Red,
Green
}
var x = Colors.Red; // type of 'x' should be 'Colors'
var p = x.Green; // error
~~~~~
!!! Property 'Green' does not exist on type 'Colors'.
x.toFixed(); // ok
// Now with generics
function fill<B extends Colors>(f: B) {
f.Green; // error
~~~~~
!!! Property 'Green' does not exist on type 'B'.
f.toFixed(); // ok
}