We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5a39e8 commit 5b1554fCopy full SHA for 5b1554f
tests/cases/conformance/types/conditional/conditionalTypes2.ts
@@ -13,21 +13,17 @@ interface Invariant<T> {
13
foo: T extends string ? keyof T : T;
14
}
15
16
-interface A { a: string }
17
-interface B extends A { b: string }
18
-
19
20
-function f1(a: Covariant<A>, b: Covariant<B>) {
+function f1<A, B extends A>(a: Covariant<A>, b: Covariant<B>) {
21
a = b;
22
b = a; // Error
23
24
25
-function f2(a: Contravariant<A>, b: Contravariant<B>) {
+function f2<A, B extends A>(a: Contravariant<A>, b: Contravariant<B>) {
26
a = b; // Error
27
b = a;
28
29
30
-function f3(a: Invariant<A>, b: Invariant<B>) {
+function f3<A, B extends A>(a: Invariant<A>, b: Invariant<B>) {
31
32
33
0 commit comments