Skip to content

Commit

Permalink
Revert "Add another test case"
Browse files Browse the repository at this point in the history
This reverts commit 510bc81.
  • Loading branch information
mhegazy committed Apr 25, 2017
1 parent e86512e commit cf17be2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 62 deletions.
31 changes: 2 additions & 29 deletions tests/baselines/reference/covariantCallbacks.errors.txt
Expand Up @@ -18,15 +18,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian
Types of property 'forEach' are incompatible.
Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'.
Types of parameters 'cb' and 'cb' are incompatible.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts(69,5): error TS2322: Type 'AList4' is not assignable to type 'BList4'.
Types of property 'forEach' are incompatible.
Type '(cb: (item: A) => A) => void' is not assignable to type '(cb: (item: B) => B) => void'.
Types of parameters 'cb' and 'cb' are incompatible.
Types of parameters 'item' and 'item' are incompatible.
Type 'A' is not assignable to type 'B'.


==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts (6 errors) ====
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts (5 errors) ====
// Test that callback parameters are related covariantly

interface P<T> {
Expand Down Expand Up @@ -108,25 +102,4 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian
!!! error TS2322: Types of property 'forEach' are incompatible.
!!! error TS2322: Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'.
!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible.
}

interface AList4 {
forEach(cb: (item: A) => A): void;
}

interface BList4 {
forEach(cb: (item: B) => B): void;
}

function f14(a: AList4, b: BList4) {
a = b;
b = a; // Error
~
!!! error TS2322: Type 'AList4' is not assignable to type 'BList4'.
!!! error TS2322: Types of property 'forEach' are incompatible.
!!! error TS2322: Type '(cb: (item: A) => A) => void' is not assignable to type '(cb: (item: B) => B) => void'.
!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible.
!!! error TS2322: Types of parameters 'item' and 'item' are incompatible.
!!! error TS2322: Type 'A' is not assignable to type 'B'.
}

}
20 changes: 1 addition & 19 deletions tests/baselines/reference/covariantCallbacks.js
Expand Up @@ -55,21 +55,7 @@ interface BList3 {
function f13(a: AList3, b: BList3) {
a = b;
b = a; // Error
}

interface AList4 {
forEach(cb: (item: A) => A): void;
}

interface BList4 {
forEach(cb: (item: B) => B): void;
}

function f14(a: AList4, b: BList4) {
a = b;
b = a; // Error
}

}

//// [covariantCallbacks.js]
// Test that callback parameters are related covariantly
Expand All @@ -94,7 +80,3 @@ function f13(a, b) {
a = b;
b = a; // Error
}
function f14(a, b) {
a = b;
b = a; // Error
}
Expand Up @@ -56,17 +56,4 @@ interface BList3 {
function f13(a: AList3, b: BList3) {
a = b;
b = a; // Error
}

interface AList4 {
forEach(cb: (item: A) => A): void;
}

interface BList4 {
forEach(cb: (item: B) => B): void;
}

function f14(a: AList4, b: BList4) {
a = b;
b = a; // Error
}
}

0 comments on commit cf17be2

Please sign in to comment.