Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala: Package import conflicts

Tags:

java

scala

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?

like image 774
0fnt Avatar asked Nov 30 '22 00:11

0fnt


2 Answers

Use import rename :

import scala.concurrent.ExecutionContext.Implicits.{global => newName}
like image 175
LMeyer Avatar answered Dec 05 '22 10:12

LMeyer


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.

like image 37
ljgw Avatar answered Dec 05 '22 11:12

ljgw