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
#06 [info] compiling 1 Scala source to /Users/lihaoyi/Github/mill/example/scalalib/basic/1-simple/out/mill-build/compile.dest/classes ...
#06 [error] /Users/lihaoyi/Github/mill/example/scalalib/basic/1-simple/build.mill:4:9: reference to Assembly is ambiguous;
#06 [error] it is imported twice in the same scope by
#06 [error] import scalalib._
#06 [error] and import javalib._
#06 [error] val x = Assembly
#06 [error] ^
#06 [error] one error found
This isn't much of a problem now, as scalalib is a strict superset of javalib, so you can just use that all the time. But it may become a problem when #3567 breaks out javalib from scalalib so that they may each have their own unique features, and #3451 introduces kotlinlib._. When a user tries to have a multi-language codebase like import javalib._, scalalib._, kotlinlib._, they will inevitably hit the errors above
A solution to this would be to ensure that the different *lib packages do not export things that their upstream dependencies already export. So e.g.
If scalalib depends on javalib, you would need import javalib._, scalalib._ to work.
And similarly if kotlinlib depends on javalib, import javalib._, kotlinlib._.
And for a project with both java/scala/kotlin, import javalib._, kotlinlib._, scalalib._ would work without ambiguity
This will involve moving/removing a bunch of forwarders, and could happen together with #3567 in 0.13.0
The text was updated successfully, but these errors were encountered:
Right now, importing both
javalib._
andscalalib._
results in an error due to ambiguity when the same classes are exported from both:This isn't much of a problem now, as
scalalib
is a strict superset ofjavalib
, so you can just use that all the time. But it may become a problem when #3567 breaks outjavalib
fromscalalib
so that they may each have their own unique features, and #3451 introduceskotlinlib._
. When a user tries to have a multi-language codebase likeimport javalib._, scalalib._, kotlinlib._
, they will inevitably hit the errors aboveA solution to this would be to ensure that the different
*lib
packages do not export things that their upstream dependencies already export. So e.g.scalalib
depends onjavalib
, you would needimport javalib._, scalalib._
to work.kotlinlib
depends onjavalib
,import javalib._, kotlinlib._
.import javalib._, kotlinlib._, scalalib._
would work without ambiguityThis will involve moving/removing a bunch of forwarders, and could happen together with #3567 in 0.13.0
The text was updated successfully, but these errors were encountered: