Closed
Description
with 0.11.0-RC1, this prints true
:
import language.strictEquality
object O {
opaque type Meters = Double
object Meters { def apply(d: Double): Meters = d }
implicit def eqM: Eq[Meters, Meters] = Eq
opaque type Feet = Double
object Feet { def apply(d: Double): Feet = d }
implicit def eqF: Eq[Feet, Feet] = Eq
def main(args: Array[String]): Unit =
println(Feet(3) == Meters(3))
}
I'd hoped for a compile error ("Values of types Feet and Meters cannot be compared with == or !=")
happens in the REPL too, without the object
wrapper, but I made this version too to make sure it wasn't a REPL artifact.
/cc @tpolecat
Metadata
Metadata
Assignees
Labels
No labels