Files
tsgo/testdata/baselines/reference/submodule/compiler/extendGenericArray.errors.txt

12 lines
338 B
Plaintext

extendGenericArray.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'.
==== extendGenericArray.ts (1 errors) ====
interface Array<T> {
foo(): T;
}
var arr: string[] = [];
var x: number = arr.foo();
~
!!! error TS2322: Type 'string' is not assignable to type 'number'.