Scala book: error on intersection types page?

The Scala book page currently at https://docs.scala-lang.org/scala3/book/types-intersection.html:

The members of an intersection type A & B are all the members of A and all the members of B.

The members of an intersection type A & B is only those members of type A that are also members of type B, right?

(The phrase “all the members of A and all the members of B” describes the members of a union type A | B, doesn’t it? Or am I missing something I’m not seeing yet?)

cross-posted to Scala Book error re intersection types? - Documentation - Scala Contributors and also resolved there

We ask that you pick one forum or the other, rather than posting to both. (And besides, in general when crossposting things in multiple places online, it’s always best to crosslink, as a courtesy, so that someone doesn’t waste their time helping you in one place, if you already got the same help elsewhere. That is the purpose of this reply.)

And should this have gone on users or contributors? I would say users by default. Almost every users thread has a possibility of eventually turning into a contributors issue, but that possibility shouldn’t be assumed from the start, especially by folks who are new to the contributors forum.

Ah, I see the problem–amiguity of the word “member.” See Scala Book error re intersection types? - #3 by dsb - Documentation - Scala Contributors

I’ve now linked this thread to the further comments in scala-contributors.

1 Like