You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classAclassBextendsAdeffoo:Future[A] =???Await.result(foo, 1.second) ===newB// okAwait.result(foo, 1.second) must beEqualTo(newB) // ok
foo must beEqualTo(newB).await // does not compile// Found: org.specs2.matcher.EqualityMatcher[B]// Required: org.specs2.matcher.Matcher[A]
This makes testing async APIs tedious, as one needs to:
foo must beEqualTo[A](newB).await
I am not sure what's the best way to fix it. I tried:
But the problem is not that the extension is not the generic type, but rather, I think, that the compiler does not know that it needs to widen B to A before attempting the extension.