Scala import not working - object is not a member of package, sbt preppends current package namespace in imports

后端 未结 12 2006
死守一世寂寞
死守一世寂寞 2020-12-14 14:28

I have an issue when trying to import in scala. The object Database exists under com.me.project.database but when I try to import it:



        
12条回答
  •  隐瞒了意图╮
    2020-12-14 14:48

    I had this issue while using Intellij and the built-in sbt shell (precisely, I was trying to run the command console, which invokes a compiler check of the code).

    In my case, after trying the other suggested solutions on this thread, I found that I could restart the sbt shell and it would go away. There's a button on the left-hand side of a looped green arrow and a small grey square which does this in one click (obviously, this is subject to Jet Brains not changing the design of the IDE!!!).

    I hope this helps some people get past this issue quickly.

提交回复
热议问题