-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tryCompiletimeConstantFold in disjointnessBoundary (#20168)
Fixes #20166 Alternatively placing the tryCompiletimeConstantFold in `AppliedType#superType` also seems to fix the issue and not break anything. But I'm not very sure about the spec here either way.
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import scala.compiletime.ops.int.* | ||
|
||
// NOTE ops.int.S is documented as equivalent to MyS | ||
|
||
type MyS[X] = X match | ||
case 0 => 1 | ||
case 1 => 2 | ||
case 2 => 3 | ||
|
||
type M[I <: Int] = 4 match | ||
case 1 - 1 => "0" | ||
case MyS[I] => "2" | ||
case S[I] => "2" // Not provablyDisjoint before changes | ||
case 2 + I => "3" | ||
case I + 3 => "4" | ||
|
||
val _: M[1] = "4" | ||
|
||
|
||
type M2[I <: Int, P] = I match | ||
case P => "b" | ||
case _ => "c" | ||
|
||
val _: M2[5, 2 + 3] = "b" |