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
!!! error TS2322: Type '0 | (T extends string ? "" : false)' is not assignable to type 'T'.
285
285
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to '0 | (T extends string ? "" : false)'.
286
286
!!! error TS2322: Type 'number' is not assignable to type 'T'.
287
-
!!! error TS2322: '0' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
287
+
!!! error TS2322: 'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
288
288
!!! error TS2322: Type 'string | number' is not assignable to type 'T'.
289
-
!!! error TS2322: '"" | 0' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
289
+
!!! error TS2322: 'string | number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
290
290
!!! error TS2322: Type 'string' is not assignable to type 'T'.
291
-
!!! error TS2322: '""' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
291
+
!!! error TS2322: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
292
292
y = x; // Error
293
293
~
294
294
!!! error TS2322: Type 'T' is not assignable to type 'ZeroOf<T>'.
Copy file name to clipboardExpand all lines: tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(3,17): error TS2322: Type 'number' is not assignable to type 'string'.
2
2
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,17): error TS2322: Type 'number' is not assignable to type 'T'.
3
-
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
3
+
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
4
4
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,27): error TS2322: Type 'T' is not assignable to type 'U'.
5
5
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
6
6
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(17,17): error TS2322: Type 'Date' is not assignable to type 'T'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(19,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
4
4
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
5
5
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,18): error TS2322: Type 'string' is not assignable to type 'T'.
6
-
'""' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string'.
6
+
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string'.
7
7
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(32,9): error TS2322: Type 'string' is not assignable to type 'T'.
8
-
'""' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string'.
8
+
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string'.
9
9
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(41,1): error TS2322: Type 'E<string>' is not assignable to type 'C<number>'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(30,23): error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
4
4
Types of parameters 'x' and 'a' are incompatible.
5
5
Type 'number' is not assignable to type 'T'.
6
-
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
6
+
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
7
7
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(33,23): error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
8
8
Types of parameters 'x' and 'a' are incompatible.
9
9
Type 'number' is not assignable to type 'T'.
10
-
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
10
+
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
11
11
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(34,24): error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
12
12
Types of parameters 'x' and 'a' are incompatible.
13
13
Type 'number' is not assignable to type 'T'.
14
-
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
14
+
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
15
15
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(35,23): error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => 1'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(15,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'.
5
5
'Date' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Date'.
6
6
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(16,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
7
-
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
7
+
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
8
8
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(25,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(50,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'.
14
14
'Date' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Date'.
15
15
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(51,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
16
-
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
16
+
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
17
17
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(60,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'.
Copy file name to clipboardExpand all lines: tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2322: Type 'number' is not assignable to type 'T'.
2
-
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Number'.
2
+
'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Number'.
3
3
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,37): error TS2322: Type 'T' is not assignable to type 'U'.
4
4
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
5
5
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,56): error TS2322: Type 'U' is not assignable to type 'V'.
Copy file name to clipboardExpand all lines: tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(2,16): error TS2558: Expected 0 type arguments, but got 1.
2
2
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(3,16): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
3
-
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
3
+
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
4
4
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(4,16): error TS2558: Expected 0 type arguments, but got 1.
5
5
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(8,17): error TS2558: Expected 0 type arguments, but got 1.
6
6
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(9,17): error TS2558: Expected 0 type arguments, but got 1.
0 commit comments