Skip to content

Commit 21bbe6b

Browse files
committed
fix case.
1 parent ce27b0e commit 21bbe6b

7 files changed

+52
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(3,8): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
22
tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(4,10): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
3+
tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(4,10): error TS2801: Proper Polymorphism type parameter T could not accept Generic type I
34

45

5-
==== tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts (2 errors) ====
6+
==== tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts (3 errors) ====
67
interface I<T> { }
78
class C<T> { }
89
var i: I;
@@ -11,4 +12,6 @@ tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(4,10): error TS231
1112
var c: C<I>;
1213
~
1314
!!! error TS2314: Generic type 'I<T>' requires 1 type argument(s).
15+
~
16+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type I
1417

tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(7,9): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
22
tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(8,9): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
33
tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(9,11): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
4+
tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(9,11): error TS2801: Proper Polymorphism type parameter T could not accept Generic type I
45
tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(10,11): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
6+
tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(10,11): error TS2801: Proper Polymorphism type parameter T could not accept Generic type C
57

68

7-
==== tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts (4 errors) ====
9+
==== tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts (6 errors) ====
810
class C<T> {
911
foo(): T { return null }
1012
}
@@ -20,7 +22,11 @@ tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(10,11): error TS231
2022
var c2: C<I>; // should be an error
2123
~
2224
!!! error TS2314: Generic type 'I<T>' requires 1 type argument(s).
25+
~
26+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type I
2327
var i2: I<C>; // should be an error
2428
~
2529
!!! error TS2314: Generic type 'C<T>' requires 1 type argument(s).
30+
~
31+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type C
2632

tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
tests/cases/compiler/genericsWithoutTypeParameters1.ts(9,9): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
22
tests/cases/compiler/genericsWithoutTypeParameters1.ts(10,9): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
33
tests/cases/compiler/genericsWithoutTypeParameters1.ts(11,11): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
4+
tests/cases/compiler/genericsWithoutTypeParameters1.ts(11,11): error TS2801: Proper Polymorphism type parameter T could not accept Generic type I
45
tests/cases/compiler/genericsWithoutTypeParameters1.ts(12,11): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
6+
tests/cases/compiler/genericsWithoutTypeParameters1.ts(12,11): error TS2801: Proper Polymorphism type parameter T could not accept Generic type C
57
tests/cases/compiler/genericsWithoutTypeParameters1.ts(14,17): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
68
tests/cases/compiler/genericsWithoutTypeParameters1.ts(14,23): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
79
tests/cases/compiler/genericsWithoutTypeParameters1.ts(15,20): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
10+
tests/cases/compiler/genericsWithoutTypeParameters1.ts(15,20): error TS2801: Proper Polymorphism type parameter T could not accept Generic type I
811
tests/cases/compiler/genericsWithoutTypeParameters1.ts(15,29): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
12+
tests/cases/compiler/genericsWithoutTypeParameters1.ts(15,29): error TS2801: Proper Polymorphism type parameter T could not accept Generic type C
913
tests/cases/compiler/genericsWithoutTypeParameters1.ts(17,13): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
1014
tests/cases/compiler/genericsWithoutTypeParameters1.ts(18,14): error TS2314: Generic type 'I<T>' requires 1 type argument(s).
1115
tests/cases/compiler/genericsWithoutTypeParameters1.ts(21,8): error TS2314: Generic type 'C<T>' requires 1 type argument(s).
@@ -15,7 +19,7 @@ tests/cases/compiler/genericsWithoutTypeParameters1.ts(27,8): error TS2314: Gene
1519
tests/cases/compiler/genericsWithoutTypeParameters1.ts(31,22): error TS2314: Generic type 'A<T>' requires 1 type argument(s).
1620

1721

18-
==== tests/cases/compiler/genericsWithoutTypeParameters1.ts (15 errors) ====
22+
==== tests/cases/compiler/genericsWithoutTypeParameters1.ts (19 errors) ====
1923
class C<T> {
2024
foo(): T { return null }
2125
}
@@ -33,9 +37,13 @@ tests/cases/compiler/genericsWithoutTypeParameters1.ts(31,22): error TS2314: Gen
3337
var c2: C<I>;
3438
~
3539
!!! error TS2314: Generic type 'I<T>' requires 1 type argument(s).
40+
~
41+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type I
3642
var i2: I<C>;
3743
~
3844
!!! error TS2314: Generic type 'C<T>' requires 1 type argument(s).
45+
~
46+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type C
3947

4048
function foo(x: C, y: I) { }
4149
~
@@ -45,8 +53,12 @@ tests/cases/compiler/genericsWithoutTypeParameters1.ts(31,22): error TS2314: Gen
4553
function foo2(x: C<I>, y: I<C>) { }
4654
~
4755
!!! error TS2314: Generic type 'I<T>' requires 1 type argument(s).
56+
~
57+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type I
4858
~
4959
!!! error TS2314: Generic type 'C<T>' requires 1 type argument(s).
60+
~
61+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type C
5062

5163
var x: { a: C } = { a: new C<number>() };
5264
~

tests/baselines/reference/missingTypeArguments1.errors.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ tests/cases/compiler/missingTypeArguments1.ts(4,15): error TS2314: Generic type
22
tests/cases/compiler/missingTypeArguments1.ts(9,26): error TS2314: Generic type 'X2<T>' requires 1 type argument(s).
33
tests/cases/compiler/missingTypeArguments1.ts(14,9): error TS2314: Generic type 'X3<T>' requires 1 type argument(s).
44
tests/cases/compiler/missingTypeArguments1.ts(19,11): error TS2314: Generic type 'X4<T>' requires 1 type argument(s).
5+
tests/cases/compiler/missingTypeArguments1.ts(19,11): error TS2801: Proper Polymorphism type parameter T could not accept Generic type X4
56
tests/cases/compiler/missingTypeArguments1.ts(24,9): error TS2314: Generic type 'X5<T>' requires 1 type argument(s).
67
tests/cases/compiler/missingTypeArguments1.ts(29,15): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
78
tests/cases/compiler/missingTypeArguments1.ts(34,26): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
89
tests/cases/compiler/missingTypeArguments1.ts(39,9): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
910
tests/cases/compiler/missingTypeArguments1.ts(44,11): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
11+
tests/cases/compiler/missingTypeArguments1.ts(44,11): error TS2801: Proper Polymorphism type parameter T could not accept Generic type Y
1012
tests/cases/compiler/missingTypeArguments1.ts(49,9): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
1113

1214

13-
==== tests/cases/compiler/missingTypeArguments1.ts (10 errors) ====
15+
==== tests/cases/compiler/missingTypeArguments1.ts (12 errors) ====
1416
interface I<T> { }
1517
class Y<T> {}
1618
class X<T> {
@@ -38,6 +40,8 @@ tests/cases/compiler/missingTypeArguments1.ts(49,9): error TS2314: Generic type
3840
p4: I<X4>
3941
~~
4042
!!! error TS2314: Generic type 'X4<T>' requires 1 type argument(s).
43+
~~
44+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type X4
4145
}
4246
var a4: X4<number>;
4347

@@ -73,6 +77,8 @@ tests/cases/compiler/missingTypeArguments1.ts(49,9): error TS2314: Generic type
7377
p9: I<Y>
7478
~
7579
!!! error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
80+
~
81+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type Y
7682
}
7783
var a9: X9<number>;
7884

tests/baselines/reference/missingTypeArguments2.errors.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
tests/cases/compiler/missingTypeArguments2.ts(3,14): error TS2314: Generic type 'A<T>' requires 1 type argument(s).
22
tests/cases/compiler/missingTypeArguments2.ts(4,5): error TS2314: Generic type 'A<T>' requires 1 type argument(s).
33
tests/cases/compiler/missingTypeArguments2.ts(5,10): error TS2314: Generic type 'A<T>' requires 1 type argument(s).
4+
tests/cases/compiler/missingTypeArguments2.ts(5,10): error TS2801: Proper Polymorphism type parameter T could not accept Generic type A
45
tests/cases/compiler/missingTypeArguments2.ts(6,5): error TS2314: Generic type 'A<T>' requires 1 type argument(s).
56

67

7-
==== tests/cases/compiler/missingTypeArguments2.ts (4 errors) ====
8+
==== tests/cases/compiler/missingTypeArguments2.ts (5 errors) ====
89
class A<T> { }
910

1011
var x: () => A;
@@ -16,6 +17,8 @@ tests/cases/compiler/missingTypeArguments2.ts(6,5): error TS2314: Generic type '
1617
var y: A<A>;
1718
~
1819
!!! error TS2314: Generic type 'A<T>' requires 1 type argument(s).
20+
~
21+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type A
1922
(): A => null;
2023
~
2124
!!! error TS2314: Generic type 'A<T>' requires 1 type argument(s).

tests/baselines/reference/neverReturningFunctions1.errors.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ tests/cases/conformance/controlFlow/neverReturningFunctions1.ts(139,9): error TS
2121
tests/cases/conformance/controlFlow/neverReturningFunctions1.ts(141,5): error TS7027: Unreachable code detected.
2222
tests/cases/conformance/controlFlow/neverReturningFunctions1.ts(148,9): error TS7027: Unreachable code detected.
2323
tests/cases/conformance/controlFlow/neverReturningFunctions1.ts(153,5): error TS7027: Unreachable code detected.
24+
tests/cases/conformance/controlFlow/neverReturningFunctions1.ts(204,74): error TS2801: Proper Polymorphism type parameter T could not accept Generic type Component
2425

2526

26-
==== tests/cases/conformance/controlFlow/neverReturningFunctions1.ts (23 errors) ====
27+
==== tests/cases/conformance/controlFlow/neverReturningFunctions1.ts (24 errors) ====
2728
function fail(message?: string): never {
2829
throw new Error(message);
2930
}
@@ -274,6 +275,8 @@ tests/cases/conformance/controlFlow/neverReturningFunctions1.ts(153,5): error TS
274275
): ComponentConstructor<T>;
275276

276277
export type ComponentDefinition<T extends object = object> = T & Partial<Component> & ThisType<T & Component>;
278+
~~~~~~~~~
279+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type Component
277280

278281
const Component = registerComponent('test-component', {
279282
schema: {

tests/baselines/reference/returnTypeTypeArguments.errors.txt

+13-1
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,29 @@ tests/cases/compiler/returnTypeTypeArguments.ts(52,15): error TS2314: Generic ty
1919
tests/cases/compiler/returnTypeTypeArguments.ts(53,26): error TS2314: Generic type 'X<T>' requires 1 type argument(s).
2020
tests/cases/compiler/returnTypeTypeArguments.ts(54,9): error TS2314: Generic type 'X<T>' requires 1 type argument(s).
2121
tests/cases/compiler/returnTypeTypeArguments.ts(55,11): error TS2314: Generic type 'X<T>' requires 1 type argument(s).
22+
tests/cases/compiler/returnTypeTypeArguments.ts(55,11): error TS2801: Proper Polymorphism type parameter T could not accept Generic type X
2223
tests/cases/compiler/returnTypeTypeArguments.ts(56,9): error TS2314: Generic type 'X<T>' requires 1 type argument(s).
2324
tests/cases/compiler/returnTypeTypeArguments.ts(57,15): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
2425
tests/cases/compiler/returnTypeTypeArguments.ts(58,26): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
2526
tests/cases/compiler/returnTypeTypeArguments.ts(59,9): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
2627
tests/cases/compiler/returnTypeTypeArguments.ts(60,11): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
28+
tests/cases/compiler/returnTypeTypeArguments.ts(60,11): error TS2801: Proper Polymorphism type parameter T could not accept Generic type Y
2729
tests/cases/compiler/returnTypeTypeArguments.ts(61,9): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
2830
tests/cases/compiler/returnTypeTypeArguments.ts(65,15): error TS2314: Generic type 'X<T>' requires 1 type argument(s).
2931
tests/cases/compiler/returnTypeTypeArguments.ts(66,26): error TS2314: Generic type 'X<T>' requires 1 type argument(s).
3032
tests/cases/compiler/returnTypeTypeArguments.ts(67,9): error TS2314: Generic type 'X<T>' requires 1 type argument(s).
3133
tests/cases/compiler/returnTypeTypeArguments.ts(68,11): error TS2314: Generic type 'X<T>' requires 1 type argument(s).
34+
tests/cases/compiler/returnTypeTypeArguments.ts(68,11): error TS2801: Proper Polymorphism type parameter T could not accept Generic type X
3235
tests/cases/compiler/returnTypeTypeArguments.ts(69,9): error TS2314: Generic type 'X<T>' requires 1 type argument(s).
3336
tests/cases/compiler/returnTypeTypeArguments.ts(70,15): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
3437
tests/cases/compiler/returnTypeTypeArguments.ts(71,26): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
3538
tests/cases/compiler/returnTypeTypeArguments.ts(72,9): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
3639
tests/cases/compiler/returnTypeTypeArguments.ts(73,11): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
40+
tests/cases/compiler/returnTypeTypeArguments.ts(73,11): error TS2801: Proper Polymorphism type parameter T could not accept Generic type Y
3741
tests/cases/compiler/returnTypeTypeArguments.ts(74,9): error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
3842

3943

40-
==== tests/cases/compiler/returnTypeTypeArguments.ts (37 errors) ====
44+
==== tests/cases/compiler/returnTypeTypeArguments.ts (41 errors) ====
4145
class One<T>{
4246
value: T;
4347
}
@@ -135,6 +139,8 @@ tests/cases/compiler/returnTypeTypeArguments.ts(74,9): error TS2314: Generic typ
135139
p4: I<X>
136140
~
137141
!!! error TS2314: Generic type 'X<T>' requires 1 type argument(s).
142+
~
143+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type X
138144
p5: X
139145
~
140146
!!! error TS2314: Generic type 'X<T>' requires 1 type argument(s).
@@ -150,6 +156,8 @@ tests/cases/compiler/returnTypeTypeArguments.ts(74,9): error TS2314: Generic typ
150156
p9: I<Y>
151157
~
152158
!!! error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
159+
~
160+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type Y
153161
pa: Y
154162
~
155163
!!! error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
@@ -168,6 +176,8 @@ tests/cases/compiler/returnTypeTypeArguments.ts(74,9): error TS2314: Generic typ
168176
p4: I<X>
169177
~
170178
!!! error TS2314: Generic type 'X<T>' requires 1 type argument(s).
179+
~
180+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type X
171181
p5: X
172182
~
173183
!!! error TS2314: Generic type 'X<T>' requires 1 type argument(s).
@@ -183,6 +193,8 @@ tests/cases/compiler/returnTypeTypeArguments.ts(74,9): error TS2314: Generic typ
183193
p9: I<Y>
184194
~
185195
!!! error TS2314: Generic type 'Y<T>' requires 1 type argument(s).
196+
~
197+
!!! error TS2801: Proper Polymorphism type parameter T could not accept Generic type Y
186198
pa: Y
187199
~
188200
!!! error TS2314: Generic type 'Y<T>' requires 1 type argument(s).

0 commit comments

Comments
 (0)