20 lines
No EOL
1,018 B
Text
20 lines
No EOL
1,018 B
Text
tests/cases/compiler/typeParameterArgumentEquivalence3.ts(4,5): error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'.
|
|
Type 'boolean' is not assignable to type 'T'.
|
|
tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'.
|
|
Type 'T' is not assignable to type 'boolean'.
|
|
|
|
|
|
==== 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
|
|
~
|
|
!!! error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'.
|
|
!!! error TS2322: Type 'boolean' is not assignable to type 'T'.
|
|
y = x; // Shound be an error
|
|
~
|
|
!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'.
|
|
!!! error TS2322: Type 'T' is not assignable to type 'boolean'.
|
|
}
|
|
|