munit icon indicating copy to clipboard operation
munit copied to clipboard

Usage with > 3.1.2 doesn't show the `@implicitNotFound` in `Compare.scala`

Open ckipp01 opened this issue 3 years ago • 3 comments

I came across this today when trying to update some stuff in the Dotty Community build and realized that munit when synced was actually failing in the community build. The error that it's failing with is the same that you see in https://github.com/scalameta/munit/pull/545 where the expected message for the @implicitNotFound on the Compare trait is no longer showing and instead you just get:

missing argument for parameter compare of method assertEquals in trait Assertions: (implicit loc: munit.Location, compare: munit.Compare[None.type, Some[Int]])

Looking at the commits between 3.1.2 and 3.1.3 it wasn't clear what was causing this, and I didn't try and bisect it yet.

You can see the same failures in a pr in Dotty here: https://github.com/lampepfl/dotty/runs/7481846884?check_suite_focus=true

ckipp01 avatar Jul 23 '22 19:07 ckipp01

~Also adding that when I try to minimally reproduce this same scenario with 3.1.2 and 3.1.3 in a hello world project that is using @implicitNotFound, both work fine. So it's something more involved here. Also looking more closely I think this might be a red herring and something else is going wrong here before it even needs to look for the @implicitNotFound message.~

Actually in a minimal test I can reproduce this using 3.1.3 with:

  implicit val x: Compare[List[Int], Vector[Int]] = ???

  test("reproduce") {
    assertEquals[List[Int], Vector[Int]](List(1), Vector(1))
  }

The above works fine, but remove x and you won't see the @implicitNotFound message.

However, just trying to reproduce this minimally with a missing implicit in a regular file I can't reproduce.

ckipp01 avatar Jul 24 '22 09:07 ckipp01

Ahh, I overlooked this issue and ran into the same problem here: https://github.com/scalameta/munit/pull/733

I was able to reproduce outside of munit and opened an issue upstream: https://github.com/lampepfl/dotty/issues/19594

valencik avatar Feb 02 '24 14:02 valencik