We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
strictEquality
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
with 0.11.0-RC1, this prints true:
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.
object
/cc @tpolecat
The text was updated successfully, but these errors were encountered:
d48786c
Merge pull request #5624 from dotty-staging/fix-#5546
04c7aa1
Fix #5546: Disallow comparing opaque types under -language:strictEqua…
Fix scala#5546: Disallow comparing opaque types under -language:stric…
97881c3
…tEquality Disallow comparing different opaque types under -language:strictEquality
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
with 0.11.0-RC1, this prints
true
: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
The text was updated successfully, but these errors were encountered: