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
if (!strictNullChecks && (!getConstraintOfType(source as TypeVariable) || (sourceFlags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any))) {
19568
19568
// A type variable with no constraint is not related to the non-primitive object type.
19569
19569
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive), RecursionFlags.Both)) {
19570
19570
resetErrorInfo(saveErrorInfo);
19571
19571
return result;
19572
19572
}
19573
19573
}
19574
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,19 +1,15 @@
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'.
5
4
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[]'.
6
5
Types of parameters 'x' and 'x' are incompatible.
7
6
Type 'T' is not assignable to type 'number'.
8
-
Type 'unknown' is not assignable to type 'number'.
9
7
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'.
10
8
Types of parameters 'x' and 'x' are incompatible.
11
9
Type 'T' is not assignable to type 'number'.
12
-
Type 'unknown' is not assignable to type 'number'.
13
10
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'.
14
11
Types of parameters 'x' and 'x' are incompatible.
15
12
Type 'T' is not assignable to type 'string'.
16
-
Type 'unknown' is not assignable to type 'string'.
17
13
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'.
18
14
Types of parameters 'x' and 'x' are incompatible.
19
15
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,7 +1,6 @@
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'.
5
4
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'.
6
5
Types of parameters 'x' and 'x' are incompatible.
7
6
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[]'.
57
55
Type 'T[]' is not assignable to type 'string[]'.
58
56
Type 'T' is not assignable to type 'string'.
59
-
Type 'unknown' is not assignable to type 'string'.
60
57
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[]'.
61
58
Type 'T[]' is not assignable to type 'string[]'.
62
59
Type 'T' is not assignable to type 'string'.
63
-
Type 'unknown' is not assignable to type 'string'.
64
60
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; }'.
105
104
!!! error TS2322: Types of property 'a' are incompatible.
106
105
!!! 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.
75
74
!!! error TS2322: Type '{ a: T; b: T; }' is not assignable to type '{ a: Base; b: Base; }'.
76
75
!!! error TS2322: Types of property 'a' are incompatible.
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.
76
+
!!! error TS2322: Type 'T' is not assignable to type 'Base'.
Copy file name to clipboardExpand all lines: tests/baselines/reference/assignmentCompatWithConstructSignatures3.errors.txt
-10
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,15 @@
1
1
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts(47,1): error TS2322: Type 'new (x: number) => number[]' is not assignable to type 'new <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'.
5
4
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts(50,1): error TS2322: Type 'new (x: number) => string[]' is not assignable to type 'new <T>(x: T) => string[]'.
6
5
Types of parameters 'x' and 'x' are incompatible.
7
6
Type 'T' is not assignable to type 'number'.
8
-
Type 'unknown' is not assignable to type 'number'.
9
7
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts(53,1): error TS2322: Type 'new (x: number) => void' is not assignable to type 'new <T>(x: T) => T'.
10
8
Types of parameters 'x' and 'x' are incompatible.
11
9
Type 'T' is not assignable to type 'number'.
12
-
Type 'unknown' is not assignable to type 'number'.
13
10
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts(56,1): error TS2322: Type 'new (x: string, y: number) => string' is not assignable to type 'new <T, U>(x: T, y: U) => T'.
14
11
Types of parameters 'x' and 'x' are incompatible.
15
12
Type 'T' is not assignable to type 'string'.
16
-
Type 'unknown' is not assignable to type 'string'.
17
13
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts(59,1): error TS2322: Type 'new (x: (arg: string) => number) => string' is not assignable to type 'new <T, U>(x: (arg: T) => U) => T'.
18
14
Types of parameters 'x' and 'x' are incompatible.
19
15
Types of parameters 'arg' and 'arg' are incompatible.
0 commit comments