Scalatest: Implicit search fails when using -Ypartial-unification

Created on 7 Jun 2017  路  8Comments  路  Source: scalatest/scalatest

https://github.com/scala/bug/issues/10352

I believe this is actually a scalac bug but am posting the issue here in case anyone else has the problem.

This minimized example succeeds without partial unification enabled:

import org.scalatest._

object Main extends App {
  class ExampleSpec extends FlatSpec with Matchers { 
    val thisAlwaysWorks = implicitly[org.scalatest.enablers.Containing[List[(String, String)]]]
    val thisOnlyWorksWithoutPartialUnification = implicitly[org.scalatest.enablers.Containing[Map[String, String]]]
  }

  println("Finished")
}

https://scastie.scala-lang.org/ShaneDelmore/AgxyUzO5Rai91ev8CgM60g

And the same code with partial unification enabled fails:
https://scastie.scala-lang.org/ShaneDelmore/UZ5m3bTERLeUTdZrFbUUUw/1

Most helpful comment

Any chance we could get a 3.0.6 release so we can consume the fix and close this issue?

All 8 comments

any news?

Partial-unification will be enabled by default in 2.13! That's not the news you were looking for was it?

I updated to 3.0.5 and Scala 2.13.0-M2, still broken https://scastie.scala-lang.org/ShaneDelmore/t1aXpT5ORtO9gNgW6YQNEA/1

All jokes aside, fingers crossed this will get more visibility once 2.13 lands. I'm no longer working with scalatest as I was when I discovered this and doubt I will have time to fix it myself, but Miles Sabin felt this was likely caused by extra implicits added specifically to work around the lack of partial unification so it may be as simple as removing a few implicits, but it may be tricky to do that in a way that doesn't break users who don't have partial-unification enabled.

Just to add more visibility to this, I'm having exactly the same problem when comparing two Maps using theSameElementsAs.

@BalmungSan Thanks for the ping. I've been kicking this can down the road for a while, busy with other tasks. But 2.13 is not far off now, so we'd better investigate pronto.

Sorry for the delay, I'll look into this now.

Any chance we could get a 3.0.6 release so we can consume the fix and close this issue?

馃

Was this page helpful?
0 / 5 - 0 ratings