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