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

前端 未结 6 1276
清歌不尽
清歌不尽 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:08

    Not sure if this was an IDE bug, but for me upgrading the IDE to latest didn't proved to be of any help. After wasting few hours here is my approach to resolve this error. Which states following.

    could not find implicit value for parameter prettifier: org.scalactic.Prettifier
    

    Solution :

    In IntelliJ press Ctrl+Alt+Shift+S -> Modules -> Dependencies -> Search for 
    org.scalactic:3.0.0.jar (Test scope) and most probably there would be 
    another version as 2.x.x in compile scope. Right click on 2.x.x and select 
    EDIT and then choose the 3.0.0 version in compile scope, and apply new 
    settings.
    
    P.S. Depending on your case there may be only one entry but make sure you 
    use 3.0.0 in compile scope to get rid of that weird error.
    

提交回复
热议问题