Suppress 'match is not exhaustive!' warning (#24408)

* Suppress 'match is not exhaustive!' warning

Not super clean, but gets rid of the compiler warning shown every time this
file is compiled.

* Using a NotImplementedError rather than a MatchError
This commit is contained in:
Arnout Engelen 2018-01-25 15:22:11 +01:00 committed by GitHub
parent 22b10dbef0
commit c1e0522970
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,8 +88,8 @@ class ActorContextAskSpec extends TestKit(ActorContextAskSpec.config) with Typed
val snitch = Behaviors.deferred[AnyRef] { (ctx)
ctx.ask(pingPong)(Ping) {
// uh oh, missing case for the response, this can never end well
case Failure(x) x
case Success(msg) throw new NotImplementedError(msg.toString)
case Failure(x) x
}
Behaviors.immutable[AnyRef] {
@ -104,11 +104,11 @@ class ActorContextAskSpec extends TestKit(ActorContextAskSpec.config) with Typed
}
}
EventFilter[MatchError](occurrences = 1, start = "Success(Pong)").intercept {
EventFilter[NotImplementedError](occurrences = 1, start = "Pong").intercept {
spawn(snitch)
}
// no-match should cause failure and subsequent stop of actor
// the exception should cause a failure which should stop the actor
probe.expectMsg("stopped")
}