14 lines
550 B
Text
14 lines
550 B
Text
|
==== tests/cases/compiler/typeParameterArgumentEquivalence3.ts (2 errors) ====
|
||
|
function foo<T,U>() {
|
||
|
var x: (item) => T;
|
||
|
var y: (item) => boolean;
|
||
|
x = y; // Should be an error
|
||
|
~
|
||
|
!!! Type '(item: any) => boolean' is not assignable to type '(item: any) => T':
|
||
|
!!! Type 'boolean' is not assignable to type 'T'.
|
||
|
y = x; // Shound be an error
|
||
|
~
|
||
|
!!! Type '(item: any) => T' is not assignable to type '(item: any) => boolean':
|
||
|
!!! Type 'T' is not assignable to type 'boolean'.
|
||
|
}
|
||
|
|