Intellij compile failures: “is already defined as”

后端 未结 10 1763
北海茫月
北海茫月 2021-02-03 17:14

I\'ve got a scala project that compiles, runs and tests fine when using SBT from the command line. However, when building the project in intellij, it seems every class in the pr

10条回答
  •  时光取名叫无心
    2021-02-03 17:25

    I'll just add mine to the list in case anyone else made this beginner mistake: I temporarily "saved my progress" by doing cp Foo.scala Foo-save.scala, forgetting that sbt would try to compile all the .scala files in the directory.

    (I don't know, I guess I was thinking of programming languages where any file not explicitly included was ignored ...)

    Of course, since both the main file and the "temporary backup" file defined the same classes ... yeah.

提交回复
热议问题