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
The latter example is "harder" in the sense that user's _root_ does clash with any possible selection; that is, _root_._root_.C is required to disambiguate.
Of course, no one writes code like this, but maybe it indicates an issue with lookups for the definition of object X.
The text was updated successfully, but these errors were encountered:
// Shortcut for the root package, this is not just a performance// optimization, it also avoids forcing imports thus potentially avoiding// cyclic references.if (name == nme.ROOTPKG)
return tree.withType(defn.RootPackage.termRef)
References #18020, didn't actually fix that, because it addressed
aspects of using `_root_` in definitions. Adding more details to that
ticket.
Fixes#17757Fixes#18050
Includes the code in scala/bug#12508
Compiler version
3.3.0
Minimized code
Output
Expectation
_root_
is an ordinary identifier except in a selection_root_.x
, so this should just work, especially since the example below works.Example is from https://github.com/scala/scala/blob/2.13.x/test/files/neg/t6217c.scala
Dotty compiles the example in scala/bug#12508 where the user packaging is top-level:
That produces packages
_root_
and_root_.p
.The latter example is "harder" in the sense that user's
_root_
does clash with any possible selection; that is,_root_._root_.C
is required to disambiguate.Of course, no one writes code like this, but maybe it indicates an issue with lookups for the definition of
object X
.The text was updated successfully, but these errors were encountered: