Closed
Description
Compiler version
3.7.0-RC1-bin-20250228-e592b37-NIGHTLY
Minimized code
A bit extended version of #22705
object Native {
class O {
def f: String = "F"
}
class M extends O
}
object Types {
opaque type N = Native.O
opaque type GS = Native.M
type S = N | GS
object S:
def apply(): S = new N
extension (s: S)
def f: String = "S"
}
import Types.*
object Main {
def main(args: Array[String]): Unit = {
val v: S = S()
println(v.f)
}
}
Output
Extension method f will never be selected from type <none>
because <none> already has a member with the same name and compatible parameter types.
def f: String = "S"
Expectation
The warning should not reference a type as <none>
.