9 lines
268 B
Text
9 lines
268 B
Text
|
==== tests/cases/compiler/extendGenericArray.ts (1 errors) ====
|
||
|
interface Array<T> {
|
||
|
foo(): T;
|
||
|
}
|
||
|
|
||
|
var arr: string[] = [];
|
||
|
var x: number = arr.foo();
|
||
|
~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Type 'string' is not assignable to type 'number'.
|