本文介绍了Scala:包导入冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在导入一个隐含的:scala.concurrent.ExecutionContext.Implicits.global,在此之前,我 import global.Analytics.xyzMethod
,其中global是一个目录在我的包裹里。但是,出于某种原因,scala这个全局的东西与第一个全局相同。我如何解决这个问题?
解决方案
试试这个:
import _root_.global.Analytics.xyzMethod
参见:
I'm importing an implicit: scala.concurrent.ExecutionContext.Implicits.global, and before this, I import global.Analytics.xyzMethod
, where global is a directory in my package. However, for some reason, scala things this global is same as the first global. How do I resolve this?
解决方案
Try this:
import _root_.global.Analytics.xyzMethod
see also:scala package conflict
edit: I'm unfortunately unable to address the concern of som-snytt properly. Please take his comment into account.
这篇关于Scala:包导入冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!