16 lines
No EOL
432 B
Text
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'. |