Skip to content

Commit

Permalink
union/intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnhoekstra committed Jul 2, 2021
1 parent b938a79 commit 35defb9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/library-aux/scala/Any.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ abstract class Any {
* For example, `List(1, 2, 3).isInstanceOf[List[String]]` will return true.
* - `T0` is some singleton type `x.type` or literal `x`: this method returns `this.eq(x)`.
* For example, `x.isInstanceOf[1]` is equivalent to `x.eq(1)`
* - `T0` is a union `X with Y`: this method is equivalent to `x.isInstanceOf[X] && x.isInstanceOf[Y]`
* - `T0` is an intersection `X with Y` or `X & Y: this method is equivalent to `x.isInstanceOf[X] && x.isInstanceOf[Y]`
* - `T0` is a union `X | Y`: this method is equivalent to `x.isInstanceOf[X] || x.isInstanceOf[Y]`
* - `T0` is a type parameter or an abstract type member: this method is equivalent
* to `isInstanceOf[U]` where `U` is `A`'s upper bound, `Any` if `A` is unbounded.
* For example, `x.isInstanceOf[A]` where `A` is an unbounded type parameter
Expand Down

0 comments on commit 35defb9

Please sign in to comment.