ignoreMsg of TestKit must accept messages of type Any instead of beeing constrained to AnyRef
import org.scalatest.WordSpec
import org.scalatest.matchers.MustMatchers
import akka.actor.testkit.Testkit
class Ticket001Spec extends TestKit(ActorSystem()) with WordSpec with MustMatchers {
"ignoreMsg" must {
"compile with T <: Any" in {
val probe = TestProbe()
probe.ignoreMsg {
case x: Long => true
}
}
}
}
Compiler error
[error] pattern type is incompatible with expected type;
[error] found : Long
[error] required: java.lang.Object
[error] case x : Long => false
[error] ^
Leave a comment
on 2012-10-30 03:29 *
By viktorklang
Assigned to set to viktorklang
Status changed from New to Accepted