Why “could not find implicit” error in Scala + Intellij + ScalaTest + Scalactic but not from sbt

前端 未结 6 1317
清歌不尽
清歌不尽 2021-01-07 23:55

I have this code that is working 100% from sbt , executing sbt test but throw a compilation error in Intellij Idea.

import org.         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-08 00:15

    Workarounds at the bottom of the response. ;)

    This problem is related with this list of BUGs:

    • SCL-8167
    • SCL-11083
    • SCL-8396
    • SCL-10912

    The problem is that there are dependencies in the project that are using, using test scope, other versions of scalatest and scalactic.

    IntelliJ Idea is mixing compile scope and test scope, but SBT is working correctly. IntelliJ Idea team said in the BUG that they are working in this.

    My workaround, at the moment, has been move to the same older version that the other libraries are using for testing.

    Notes:

    @justin-kaeser is assigned and working to fix this. Thx!

    A lot of improvement related to the Scala plugin in that latest previews.

    Example to reproduce the error : https://github.com/angelcervera/idea-dependencies-bug

    Few Workarounds:

    1. Remove problematic dependencies from the Project structure -> Modules
    2. Exclude libraries in the sbt.
    3. Use the same version.
    4. Try with the last EAP: https://www.jetbrains.com/idea/nextversion/

提交回复
热议问题