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?
2 Answers
Use import rename :
import scala.concurrent.ExecutionContext.Implicits.{global => newName}
-
Thanks, actually I should have noted I know this (and also because this is the simpler answer) :) Thanks again, I've upvoted both, but would be accepting the other as answer...– 0fntAug 8, 2014 at 8:17
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.
-
This answer seems to be wrong or incomplete. If
global
is a subpackage of the current package:imported 'global' is permanently hidden by definition of package global in package maqicode
. Aug 8, 2014 at 15:25 -
@som-snytt: hmm,.. you raise an interesting point. Unfortunately I'm unable to modify my answer to reflect this properly, so I will delete this answer. (..and I find that I cannot, as the answer is already accepted)– ljgwAug 11, 2014 at 5:45