-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Tried with @hamzaremmal.
Compiler version
3.8.0-RC1-bin-20250822-658c8bd-NIGHTLY
Minimized code
import scala.annotation.targetName
def f(x: Int): Unit =
println("Int")
@targetName("f_42")
def f(x: 42): Unit =
println("42")
@targetName("f_43")
def f(x: 43): Unit =
println("43")
inline def fourtyTwo = 42
@main def Test =
val x: 43 = (42: Int) + 1
f((42: Int)) // prints "Int"
f((42: Int) + 1) // prints "43"
f((42 + 1): Int) // prints "Int"Output
$ scala -S 3.8.nightly -Xprint:genBCode test.scala
Compiled project (Scala 3.8.0-RC1-bin-20250822-658c8bd-NIGHTLY, JVM (17))
Int
43
IntExpectation
Maybe val x shouldn't type-check, and f((42: Int) + 1) should resolve to f instead of f_43?