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
assertEquals(List(1).headOption, Some(1))
// Cannot prove that Option[Int] =:= Some[Int]
We might want to allow the right-hand side (expected value) to be a subtype of the right hand side
assertEquals(List(1).headOption, Some(1)) // OK
assertEquals(Some(1), List(1).headOption) // ERROR: Cannot prove that Option[Int] <:< Some[Int]
The reasoning being that the expected value is often a hardcoded expression like "Some(1)" while the obtained value comes from a generic method implementation.
The text was updated successfully, but these errors were encountered:
I'm gonna close this as wontfix. If there is demand, I'm open to add a new assertAnyEquals() helpers that takes Any arguments so that it's possible to for example compare Left[Int, Nothing] with Either[Int, Nothing] but it's not a method that I have found the need for so far.
Context: https://gitter.im/scalameta/munit?at=5e36e5cadc52c34ace3fd552
Currently, the following code does not typecheck
We might want to allow the right-hand side (expected value) to be a subtype of the right hand side
The reasoning being that the expected value is often a hardcoded expression like "Some(1)" while the obtained value comes from a generic method implementation.
The text was updated successfully, but these errors were encountered: