You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dotty thinks that every package compiled by Scala 2 has the eq method in it. This gives two consequences.
First, strange code compiles. Considering as an example, you have cats library in dependencies, you have
valz= cats.eq(newObject) // Compiles!
Second, all objects that have name eq in such packages, become unavailable. Considering, for example, you have cats-laws library in dependencies, this code
importcats.laws.discipline.eq._
fails with
[error] -- Error: dotty-eq-bug/src/main/scala/dottyeq/tst-pos.scala:4:28
[error] 4 |import cats.laws.discipline.eq._
[error] | ^^^^^^^^^^^^^^^^^^^^^^^
[error] | Object => Boolean is not stable
This error appears both in pure dotty mode and in dotty's scala 2 compatibility mode.
The minimal project showing both errors can be found here.
The text was updated successfully, but these errors were encountered:
Both cats and cats.laws.discipline contain a package object, and objects always have an eq method, so Dotty's behavior isn't completely unreasonable here but we should still align with Scala 2. @adriaanm do you happen to know if scalac has some logic somewhere to skip members of Any when looking into package objects ?
Dotty thinks that every package compiled by Scala 2 has the
eq
method in it. This gives two consequences.First, strange code compiles. Considering as an example, you have
cats
library in dependencies, you haveSecond, all
object
s that have nameeq
in such packages, become unavailable. Considering, for example, you havecats-laws
library in dependencies, this codefails with
This error appears both in pure dotty mode and in dotty's scala 2 compatibility mode.
The minimal project showing both errors can be found here.
The text was updated successfully, but these errors were encountered: