What is the _root_ package in Scala?

前端 未结 3 721
面向向阳花
面向向阳花 2020-12-10 00:41

I\'m using IntelliJ IDEA with the Scala plugin. If I reference HashMap in code, and then use Alt-Enter to add the import, the package gets imported as:

_root         


        
3条回答
  •  醉话见心
    2020-12-10 01:07

    The Scala language specification has this to say about _root_ in section 9.4 Package References

    The special predefined name _root_ refers to the outermost root package which contains all top-level packages.

    See the following PDF for the full language reference: http://www.scala-lang.org/docu/files/ScalaReference.pdf

提交回复
热议问题