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:
parent
22b10dbef0
commit
c1e0522970
1 changed files with 4 additions and 4 deletions
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue