mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
34 lines
2.4 KiB
Plaintext
34 lines
2.4 KiB
Plaintext
genericAssignmentCompatOfFunctionSignatures1.ts(4,1): error TS2322: Type '<T, U extends { a: T; b: number; }>(x: T, z: U) => void' is not assignable to type '<T, U extends { a: T; b: string; }>(x: T, z: U) => void'.
|
|
Types of parameters 'z' and 'z' are incompatible.
|
|
Type 'U' is not assignable to type '{ a: T; b: number; }'.
|
|
Type '{ a: T; b: string; }' is not assignable to type '{ a: T; b: number; }'.
|
|
Types of property 'b' are incompatible.
|
|
Type 'string' is not assignable to type 'number'.
|
|
genericAssignmentCompatOfFunctionSignatures1.ts(5,1): error TS2322: Type '<T, U extends { a: T; b: string; }>(x: T, z: U) => void' is not assignable to type '<T, U extends { a: T; b: number; }>(x: T, z: U) => void'.
|
|
Types of parameters 'z' and 'z' are incompatible.
|
|
Type 'U' is not assignable to type '{ a: T; b: string; }'.
|
|
Type '{ a: T; b: number; }' is not assignable to type '{ a: T; b: string; }'.
|
|
Types of property 'b' are incompatible.
|
|
Type 'number' is not assignable to type 'string'.
|
|
|
|
|
|
==== genericAssignmentCompatOfFunctionSignatures1.ts (2 errors) ====
|
|
var x1 = function foo3<T, U extends { a: T; b: string }>(x: T, z: U) { }
|
|
var x2 = function foo3<T, U extends { a: T; b: number }>(x: T, z: U) { }
|
|
|
|
x1 = x2;
|
|
~~
|
|
!!! error TS2322: Type '<T, U extends { a: T; b: number; }>(x: T, z: U) => void' is not assignable to type '<T, U extends { a: T; b: string; }>(x: T, z: U) => void'.
|
|
!!! error TS2322: Types of parameters 'z' and 'z' are incompatible.
|
|
!!! error TS2322: Type 'U' is not assignable to type '{ a: T; b: number; }'.
|
|
!!! error TS2322: Type '{ a: T; b: string; }' is not assignable to type '{ a: T; b: number; }'.
|
|
!!! error TS2322: Types of property 'b' are incompatible.
|
|
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
|
x2 = x1;
|
|
~~
|
|
!!! error TS2322: Type '<T, U extends { a: T; b: string; }>(x: T, z: U) => void' is not assignable to type '<T, U extends { a: T; b: number; }>(x: T, z: U) => void'.
|
|
!!! error TS2322: Types of parameters 'z' and 'z' are incompatible.
|
|
!!! error TS2322: Type 'U' is not assignable to type '{ a: T; b: string; }'.
|
|
!!! error TS2322: Type '{ a: T; b: number; }' is not assignable to type '{ a: T; b: string; }'.
|
|
!!! error TS2322: Types of property 'b' are incompatible.
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'. |