You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// A type variable with no constraint is not related to the non-primitive object type.
19555
19569
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive), RecursionFlags.Both)) {
@@ -19558,12 +19572,12 @@ namespace ts {
19558
19572
}
19559
19573
}
19560
19574
// hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
Copy file name to clipboardExpand all lines: tests/baselines/reference/assignmentCompatWithCallSignatures3.errors.txt
+10
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,19 @@
1
1
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(47,1): error TS2322: Type '(x: number) => number[]' is not assignable to type '<T>(x: T) => T[]'.
2
2
Types of parameters 'x' and 'x' are incompatible.
3
3
Type 'T' is not assignable to type 'number'.
4
+
Type 'unknown' is not assignable to type 'number'.
4
5
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(50,1): error TS2322: Type '(x: number) => string[]' is not assignable to type '<T>(x: T) => string[]'.
5
6
Types of parameters 'x' and 'x' are incompatible.
6
7
Type 'T' is not assignable to type 'number'.
8
+
Type 'unknown' is not assignable to type 'number'.
7
9
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(53,1): error TS2322: Type '(x: number) => void' is not assignable to type '<T>(x: T) => T'.
8
10
Types of parameters 'x' and 'x' are incompatible.
9
11
Type 'T' is not assignable to type 'number'.
12
+
Type 'unknown' is not assignable to type 'number'.
10
13
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(56,1): error TS2322: Type '(x: string, y: number) => string' is not assignable to type '<T, U>(x: T, y: U) => T'.
11
14
Types of parameters 'x' and 'x' are incompatible.
12
15
Type 'T' is not assignable to type 'string'.
16
+
Type 'unknown' is not assignable to type 'string'.
13
17
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(59,1): error TS2322: Type '(x: (arg: string) => number) => string' is not assignable to type '<T, U>(x: (arg: T) => U) => T'.
14
18
Types of parameters 'x' and 'x' are incompatible.
15
19
Types of parameters 'arg' and 'arg' are incompatible.
Copy file name to clipboardExpand all lines: tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt
+8
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(45,9): error TS2322: Type '(x: number) => string[]' is not assignable to type '<T, U>(x: T) => U[]'.
2
2
Types of parameters 'x' and 'x' are incompatible.
3
3
Type 'T' is not assignable to type 'number'.
4
+
Type 'unknown' is not assignable to type 'number'.
4
5
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(49,9): error TS2322: Type '(x: (arg: Base) => Derived) => (r: Base) => Derived2' is not assignable to type '<T extends Base, U extends Derived, V extends Derived2>(x: (arg: T) => U) => (r: T) => V'.
5
6
Types of parameters 'x' and 'x' are incompatible.
6
7
Types of parameters 'arg' and 'arg' are incompatible.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(90,9): error TS2322: Type '<T>(x: T) => T[]' is not assignable to type '<T>(x: T) => string[]'.
55
57
Type 'T[]' is not assignable to type 'string[]'.
56
58
Type 'T' is not assignable to type 'string'.
59
+
Type 'unknown' is not assignable to type 'string'.
57
60
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(95,9): error TS2322: Type '<T>(x: T) => T[]' is not assignable to type '<T>(x: T) => string[]'.
58
61
Type 'T[]' is not assignable to type 'string[]'.
59
62
Type 'T' is not assignable to type 'string'.
63
+
Type 'unknown' is not assignable to type 'string'.
60
64
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(96,9): error TS2322: Type '<T>(x: T) => string[]' is not assignable to type '<T>(x: T) => T[]'.
!!! error TS2322: Type '{ a: U; b: V; }' is not assignable to type '{ a: Base; b: Base; }'.
104
105
!!! error TS2322: Types of property 'a' are incompatible.
105
106
!!! error TS2322: Type 'U' is not assignable to type 'Base'.
107
+
!!! error TS2322: Property 'foo' is missing in type '{}' but required in type 'Base'.
108
+
!!! related TS2728 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures5.ts:3:14: 'foo' is declared here.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
74
75
!!! error TS2322: Type '{ a: T; b: T; }' is not assignable to type '{ a: Base; b: Base; }'.
75
76
!!! error TS2322: Types of property 'a' are incompatible.
76
-
!!! error TS2322: Type 'T' is not assignable to type 'Base'.
77
+
!!! error TS2322: Type 'T' is not assignable to type 'Base'.
78
+
!!! error TS2322: Property 'foo' is missing in type '{}' but required in type 'Base'.
79
+
!!! related TS2728 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures6.ts:3:14: 'foo' is declared here.
0 commit comments