-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Compiler version
3.3.6, 3.4.3, 3.5.2, 3.6.4, 3.7.3, and latest nightly 3.8.0-RC1-bin-20250923-18f22ab-NIGHTLY
Minimized code
https://scastie.scala-lang.org/mrdziuban/VrghqzrKRLmn2DdndN75RQ/18
package example {
package types {
opaque type OpaqueType[A] = Unit
object OpaqueType {
def apply[A]: OpaqueType[A] = ()
}
}
object exports {
export example.types.OpaqueType
}
import exports.*
def test[A](a: A)(using ev: A =:= Unit) = a
val proof = test(OpaqueType[String])
}Output
Successful compilation
Expectation
The call to test in val proof should not compile since OpaqueType[String] should not be seen as equivalent to Unit.
If the call is changed to test(types.OpaqueType[String]) then it does not compile, so the issue seems to be introduced by using the exported version of OpaqueType.