Skip to content

Commit f28509d

Browse files
committed
doc(intersection): mention non-variant
1 parent 211973c commit f28509d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/docs/reference/new-types/intersection-types-spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ A & B <: B A & B <: A
4545
In another word, `A & B` is the same type as `B & A`, in the sense that the two types
4646
have the same values and are subtypes of each other.
4747

48-
If `C` is a type constructor, the join `C[A] & C[B]` is simplified by pulling the
49-
intersection inside the constructor, using the following two rules:
48+
If `C` is a type constructor, then `C[A] & C[B]` can be simplified using the following three rules:
5049

5150
- If `C` is covariant, `C[A] & C[B] ~> C[A & B]`
5251
- If `C` is contravariant, `C[A] & C[B] ~> C[A | B]`
52+
- If `C` is non-variant, emit a compile error
5353

5454
When `C` is covariant, `C[A & B] <: C[A] & C[B]` can be derived:
5555

0 commit comments

Comments
 (0)