forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…pec. `derivesFrom` normally returns `false` when the receiver is `Nothing` or `Null`. However, it returns `true` if the right-hand- side happens to be exactly the same class. For the purpose of computing `provablyDisjoint`, we have to explicitly exclude those. (Note that the spec text per se only explicitly specifies `Nothing ⋔ Nothing`, not `Null ⋔ Null`, but that's because the spec text punts on the `Null` issue. The intent of `provablyDisjoint` is that there is no *non-null* value belonging to both types.)
- Loading branch information
Showing
3 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
object Test: | ||
type Disj[A, B] = | ||
A match | ||
case B => true | ||
case _ => false | ||
|
||
def f(a: Disj[1 | Nothing, 2 | Nothing]): Unit = () | ||
|
||
val t = f(false) | ||
end Test |