Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I resolve import conflicts in scala?

Tags:

scala

sbt

I launched this shell from sbt with the "console-project" command.

scala> settings
<console>:24: error: reference to settings is ambiguous;
it is imported twice in the same scope by
import Keys._
and import settings
       settings
       ^

How do I get the shell to display the settings object, not Keys.settings?

like image 479
Joseph Shraibman Avatar asked Jul 06 '11 05:07

Joseph Shraibman


1 Answers

Assuming that you imported Keys._ and settings yourself you can rename settings from Keys, like so:

import Keys.{settings => keySettings, _}
like image 130
Jan van der Vorst Avatar answered Sep 30 '22 09:09

Jan van der Vorst