fix type bounds of expectMessageClass in javadsl in Typed

This commit is contained in:
Patrik Nordwall 2018-11-12 07:53:11 +01:00
parent 0d0a0e8018
commit 4966d5262e

View file

@ -207,14 +207,14 @@ abstract class TestProbe[M] {
* Same as `expectMessageType(clazz, remainingOrDefault)`,but using the * Same as `expectMessageType(clazz, remainingOrDefault)`,but using the
* default timeout as deadline. * default timeout as deadline.
*/ */
def expectMessageClass[T](clazz: Class[T]): T = def expectMessageClass[T <: M](clazz: Class[T]): T =
expectMessageClass_internal(getRemainingOrDefault.asScala, clazz) expectMessageClass_internal(getRemainingOrDefault.asScala, clazz)
/** /**
* Wait for a message of type M and return it when it arrives, or fail if the `max` timeout is hit. * Wait for a message of type M and return it when it arrives, or fail if the `max` timeout is hit.
* The timeout is dilated. * The timeout is dilated.
*/ */
def expectMessageClass[T](clazz: Class[T], max: Duration): T = def expectMessageClass[T <: M](clazz: Class[T], max: Duration): T =
expectMessageClass_internal(max.asScala.dilated, clazz) expectMessageClass_internal(max.asScala.dilated, clazz)
/** /**