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
package foo
import foo.bar._
object B {
val y: Int = A.x
}
They compile with Scala 2.12. With Dotty, I get:
-- [E007] Type Mismatch Error: /tmp/foo/B.scala:5:17 ---------------------------
5 | val y: Int = A.x
| ^^^
| found: String(foo.bar.A.x)
| required: Int
|
one error found
In object foo.B, Scala 2.12 prefers foo.A over foo.bar.A because foo.A is in the same package. But Dotty seems to prefer foo.bar.A over foo.A because foo.bar.A is being imported.