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

16 lines
No EOL
432 B
Text

==== tests/cases/compiler/genericGetter3.ts (2 errors) ====
class A<T> { }
class C<T> {
data: A<T>;
get x(): A<T> {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
return this.data;
}
}
var c = new C<number>();
var r: string = c.x;
~~~~~~~~~~~~~~~
!!! Type 'A<number>' is not assignable to type 'string'.