20 lines
693 B
Plaintext
20 lines
693 B
Plaintext
tests/cases/compiler/genericGetter3.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/compiler/genericGetter3.ts(11,5): error TS2322: Type 'A<number>' is not assignable to type 'string'.
|
|
|
|
|
|
==== 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 TS2322: Type 'A<number>' is not assignable to type 'string'. |