fthomas / refined

Refinement types for Scala
MIT License
1.71k stars 157 forks source link

AdjacentSpec BigDecimal test case failing on recent Scala 2.13 nightlies #661

Open SethTisue opened 5 years ago

SethTisue commented 5 years ago

this came up in the Scala 2.13 community build. after https://github.com/scala/community-builds/commit/54060a29041b3e4a229ff3d138df8497640e4d97 , refined started failing with:

the problem is reproducible outside dbuild just with ++2.13.1-bin-c5eed1d (after adding a resolver) followed by coreJVM/Test/compile

looking at git log --merges 63f89ba..c5eed1d, it seems likely the cause is https://github.com/scala/scala/pull/8072

@lrytz @fthomas does this seem like a progression to you, and not a regression?

in the community build, I can work around it by temporarily excluding AdjacentSpec.scala

lrytz commented 5 years ago

Since somehow the message got lost above, it's

Expected: "could not find implicit value..."
Actual: No implicit Ordering defined for BigDecimal.

We have trait Adjacent[T] extends Ordering[T].

It is a bit confusing to see that message because implicitly[Ordering[BigDecimal]] exists.

We could include the type that is actually required in the message. Maybe also emit a warning when compiling Adjacent to suggest adding an @implicitNotFound? cc @som-snytt

som-snytt commented 5 years ago

The Scala PR moves the parent annotation text to the end of the message, so that the test just works again after the fix. It tests a prefix of the message.