Is wildcard import bad in Scala with respect to incremental compilation?

烂漫一生 提交于 2019-12-03 10:25:38

There is one tiny impact, but you probably won't notice it. The impact is that when there's a reference to symbol "Foo" the compiler must resolve "Foo" into a fully qualified name. The scope of where it can look for "Foo" is affected by wildcard imports. But that's all done in memory and you almost certainly won't notice such tiny differences in resolution speed unless you have something crazy like thousands of classes in one package.

Other than that, no impact. If you import pack._ and some arbitrary class in pack._ that you don't depend on changes then your file won't have to be recompiled.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!