Intellij Scala cats mapN error message
已回答
I am using Intellij 2018.1 with the Scala Plugin 2018.1.8 with Scala 2.12..4 and cats 1.0.1. We have noticed an error when using mapN from cats.validation. Intelij reports that it "can not resolve symbol mapN" and yet - the code works. How do we remove this error from Intellij? Below is the code that demonstrates the issue and the compiler options that I am using. Any assistance would be great!
Thank you,
James
Foo.scala
import cats.data.Validated
import cats.data.Validated.{Invalid, Valid}
object Test {
case class Foo(a: Int, b: Int)
def test: Validated[String, Foo] = {
val c = validateIsLessThan3(1)
val d = validateIsLessThan3(2)
(c, d).mapN(Foo.apply)
}
def validateIsLessThan3(number: Int): Validated[String, Int] =
if (number < 3) { Valid(number) } else { Invalid("error")}
}
I am using the following Scala Compiler Options
and the "Additional compiler options" include partial unification:
-Xlint:unsound-match
-Ywarn-unused-import
-Ywarn-dead-code
-Ywarn-inaccessible
-Ypartial-unification
-Xfatal-warnings
-deprecation:false
-feature:false
请先登录再写评论。
Looks like a known bug: https://youtrack.jetbrains.com/issue/SCL-12892.