mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
63 lines
4.0 KiB
Plaintext
63 lines
4.0 KiB
Plaintext
genericCallbackInvokedInsideItsContainingFunction1.ts(2,16): error TS2558: Expected 0 type arguments, but got 1.
|
|
genericCallbackInvokedInsideItsContainingFunction1.ts(3,16): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
|
|
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
|
genericCallbackInvokedInsideItsContainingFunction1.ts(4,16): error TS2558: Expected 0 type arguments, but got 1.
|
|
genericCallbackInvokedInsideItsContainingFunction1.ts(5,16): error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'.
|
|
'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
|
|
genericCallbackInvokedInsideItsContainingFunction1.ts(8,17): error TS2558: Expected 0 type arguments, but got 1.
|
|
genericCallbackInvokedInsideItsContainingFunction1.ts(9,17): error TS2558: Expected 0 type arguments, but got 1.
|
|
genericCallbackInvokedInsideItsContainingFunction1.ts(10,17): error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'.
|
|
'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
|
|
genericCallbackInvokedInsideItsContainingFunction1.ts(12,17): error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'.
|
|
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
|
genericCallbackInvokedInsideItsContainingFunction1.ts(13,17): error TS2558: Expected 0 type arguments, but got 1.
|
|
genericCallbackInvokedInsideItsContainingFunction1.ts(14,17): error TS2558: Expected 0 type arguments, but got 1.
|
|
genericCallbackInvokedInsideItsContainingFunction1.ts(15,17): error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'.
|
|
'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
|
|
|
|
|
|
==== genericCallbackInvokedInsideItsContainingFunction1.ts (11 errors) ====
|
|
function foo<T, U>(x:T, y:U, f: (v: T) => U) {
|
|
var r1 = f<number>(1);
|
|
~~~~~~
|
|
!!! error TS2558: Expected 0 type arguments, but got 1.
|
|
var r2 = f(1);
|
|
~
|
|
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
|
|
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
|
var r3 = f<any>(null);
|
|
~~~
|
|
!!! error TS2558: Expected 0 type arguments, but got 1.
|
|
var r4 = f(null);
|
|
~~~~
|
|
!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'.
|
|
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
|
|
|
|
var r11 = f(x);
|
|
var r21 = f<number>(x);
|
|
~~~~~~
|
|
!!! error TS2558: Expected 0 type arguments, but got 1.
|
|
var r31 = f<any>(null);
|
|
~~~
|
|
!!! error TS2558: Expected 0 type arguments, but got 1.
|
|
var r41 = f(null);
|
|
~~~~
|
|
!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'.
|
|
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
|
|
|
|
var r12 = f(y);
|
|
~
|
|
!!! error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'.
|
|
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
|
!!! related TS2208 genericCallbackInvokedInsideItsContainingFunction1.ts:1:17: This type parameter might need an `extends T` constraint.
|
|
var r22 = f<number>(y);
|
|
~~~~~~
|
|
!!! error TS2558: Expected 0 type arguments, but got 1.
|
|
var r32 = f<any>(null);
|
|
~~~
|
|
!!! error TS2558: Expected 0 type arguments, but got 1.
|
|
var r42 = f(null);
|
|
~~~~
|
|
!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'.
|
|
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
|
|
} |