-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upper bound lost from Int
to Any
on Scala 3.1.2 and later
#18253
Comments
First bad nightly: |
@soronpo You have mentioned elsewhere that this issue manifested to you as you bumped the compiler version from 3.3.0 to 3.3.1-RCx. Did it happen in https://github.com/DFiantHDL/DFiant or another project? Which branch was that? I wanted to investigate what exactly changed between 3.3.0 and 3.3.1-RCx. BTW. Since there is at least one released version on Maven Central, DFiant will be part of the Open CB starting this weekend, so new regressions will be detected (and even bisected) automatically. |
@Kordyjan Thank you for looking into this. I'm hesitant on putting the library in the OpenCB since it's still a WIP, but I see the benefit since it's a regression magnet 😄. I created a branch that will be stable for the community build: Locally just check out the branch and run |
Dale and I are digging into this, at least experimentally. No idea yet what a fix might look like. Here's the test code minimized a bit further: import scala.compiletime.ops.int.Max
trait Foo[A]
trait Bar[B]:
type Out <: Int
object Bar:
given inst[C <: Int]: Bar[C] with
type Out = C
class Test:
def mkFoo(using bx: Bar[2]): Foo[Max[1, bx.Out]] = ???
def check[Y](yy: Y, clue: Int = 1): Unit = ()
def test: Unit = check(mkFoo) it's a bit less noisy, but all the big pieces are still there, despite our best efforts 😕 |
Note that a default getter always has all the same type parameters as the method it comes from, even if they aren't used. So the getter for |
Oh, finally it make some sense. I was really surprised when I got this minimization. |
Pretty weird error. It disappears when removing the
clue
parameter fromcheck
.Compiler version
3.1.1 - compiles
3.1.2 and later - compilation error
Minimized code
Output
Expectation
Should compile.
The text was updated successfully, but these errors were encountered: