4

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 2

13

Use import rename :

import scala.concurrent.ExecutionContext.Implicits.{global => newName}
1
  • 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...
    – 0fnt
    Aug 8, 2014 at 8:17
9

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.

2
  • 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.
    – som-snytt
    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)
    – ljgw
    Aug 11, 2014 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.