Skip to content

Commit cf17be2

Browse files
committed
Revert "Add another test case"
This reverts commit 510bc81.
1 parent e86512e commit cf17be2

File tree

3 files changed

+4
-62
lines changed

3 files changed

+4
-62
lines changed

tests/baselines/reference/covariantCallbacks.errors.txt

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian
1818
Types of property 'forEach' are incompatible.
1919
Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'.
2020
Types of parameters 'cb' and 'cb' are incompatible.
21-
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts(69,5): error TS2322: Type 'AList4' is not assignable to type 'BList4'.
22-
Types of property 'forEach' are incompatible.
23-
Type '(cb: (item: A) => A) => void' is not assignable to type '(cb: (item: B) => B) => void'.
24-
Types of parameters 'cb' and 'cb' are incompatible.
25-
Types of parameters 'item' and 'item' are incompatible.
26-
Type 'A' is not assignable to type 'B'.
2721

2822

29-
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts (6 errors) ====
23+
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts (5 errors) ====
3024
// Test that callback parameters are related covariantly
3125

3226
interface P<T> {
@@ -108,25 +102,4 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian
108102
!!! error TS2322: Types of property 'forEach' are incompatible.
109103
!!! error TS2322: Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'.
110104
!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible.
111-
}
112-
113-
interface AList4 {
114-
forEach(cb: (item: A) => A): void;
115-
}
116-
117-
interface BList4 {
118-
forEach(cb: (item: B) => B): void;
119-
}
120-
121-
function f14(a: AList4, b: BList4) {
122-
a = b;
123-
b = a; // Error
124-
~
125-
!!! error TS2322: Type 'AList4' is not assignable to type 'BList4'.
126-
!!! error TS2322: Types of property 'forEach' are incompatible.
127-
!!! error TS2322: Type '(cb: (item: A) => A) => void' is not assignable to type '(cb: (item: B) => B) => void'.
128-
!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible.
129-
!!! error TS2322: Types of parameters 'item' and 'item' are incompatible.
130-
!!! error TS2322: Type 'A' is not assignable to type 'B'.
131-
}
132-
105+
}

tests/baselines/reference/covariantCallbacks.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,7 @@ interface BList3 {
5555
function f13(a: AList3, b: BList3) {
5656
a = b;
5757
b = a; // Error
58-
}
59-
60-
interface AList4 {
61-
forEach(cb: (item: A) => A): void;
62-
}
63-
64-
interface BList4 {
65-
forEach(cb: (item: B) => B): void;
66-
}
67-
68-
function f14(a: AList4, b: BList4) {
69-
a = b;
70-
b = a; // Error
71-
}
72-
58+
}
7359

7460
//// [covariantCallbacks.js]
7561
// Test that callback parameters are related covariantly
@@ -94,7 +80,3 @@ function f13(a, b) {
9480
a = b;
9581
b = a; // Error
9682
}
97-
function f14(a, b) {
98-
a = b;
99-
b = a; // Error
100-
}

tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,4 @@ interface BList3 {
5656
function f13(a: AList3, b: BList3) {
5757
a = b;
5858
b = a; // Error
59-
}
60-
61-
interface AList4 {
62-
forEach(cb: (item: A) => A): void;
63-
}
64-
65-
interface BList4 {
66-
forEach(cb: (item: B) => B): void;
67-
}
68-
69-
function f14(a: AList4, b: BList4) {
70-
a = b;
71-
b = a; // Error
72-
}
59+
}

0 commit comments

Comments
 (0)