我正在从https://www.scala-exercises.org/std_lib/implicits
开始练习对于以下问题,我的回答似乎不正确,但我不知道为什么。
object MyPredef {
class KoanIntWrapper(val original: Int) {
def isOdd = original % 2 != 0
def isEven = !isOdd
}
implicit def thisMethodNameIsIrrelevant(value: Int) =
new KoanIntWrapper(value)
}
import MyPredef._
//imported implicits come into effect within this scope
19.isOdd should be(true) //my answer but it seem incorrect
)
20.isOdd should be(false) //my answer but it seem incorrect
错误为There was a problem evaluating your answer, please try again later.