TypeScript/tests/baselines/reference/genericGetter3.errors.txt

16 lines
418 B
Plaintext

==== 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'.