From f012b8735d83624ade27c5dd93c01130c21a900b Mon Sep 17 00:00:00 2001 From: Dani Rey Date: Mon, 2 Mar 2020 20:21:57 +0100 Subject: [PATCH] Add fact that & is commutative The fact that intersection and union type operators are commutative is important. Therefore I propose to also add it to the overview page for intersection types. --- docs/docs/reference/new-types/intersection-types.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/docs/reference/new-types/intersection-types.md b/docs/docs/reference/new-types/intersection-types.md index 559958387556..367d023c6dee 100644 --- a/docs/docs/reference/new-types/intersection-types.md +++ b/docs/docs/reference/new-types/intersection-types.md @@ -29,6 +29,8 @@ The members of an intersection type `A & B` are all the members of `A` and all the members of `B`. For instance `Resettable & Growable[String]` has member methods `reset` and `add`. +`&` is _commutative_: `A & B` is the same type as `B & A`. + If a member appears in both `A` and `B`, its type in `A & B` is the intersection of its type in `A` and its type in `B`. For instance, assume the definitions: