diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index 75a62d9f6711..147e1d6e9af9 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -109,6 +109,7 @@ object BuildHelper { Seq( "-language:implicitConversions", "-Xignore-scala2-macros", + "-Xmax-inlines:64", "-noindent" ) case Some((2, 13)) => diff --git a/test/shared/src/main/scala-3/zio/test/Macros.scala b/test/shared/src/main/scala-3/zio/test/Macros.scala index 5fe262524a1e..2c8ba735a0c1 100644 --- a/test/shared/src/main/scala-3/zio/test/Macros.scala +++ b/test/shared/src/main/scala-3/zio/test/Macros.scala @@ -18,7 +18,8 @@ package zio.test import zio._ import zio.internal.stacktracer.SourceLocation -import zio.test.internal.SmartAssertions +import zio.test.diff.Diff +import zio.test.internal.{OptionalImplicit, SmartAssertions} import scala.quoted._ import scala.reflect.ClassTag @@ -166,7 +167,14 @@ object SmartAssertMacros { case Unseal(MethodCall(lhs, "==", tpes, Some(List(rhs)))) => val span = getSpan(rhs) - '{${transform(lhs.asExpr)} >>> SmartAssertions.equalTo(${rhs.asExpr}).span($span)}.asExprOf[TestArrow[Any, A]] + lhs.tpe.widen.asType match { + case '[l] => + Expr.summon[OptionalImplicit[Diff[l]]] match { + case Some(optDiff) => + '{${transform(lhs.asExpr)} >>> SmartAssertions.equalTo(${rhs.asExpr})($optDiff.asInstanceOf[OptionalImplicit[Diff[Any]]]).span($span)}.asExprOf[TestArrow[Any, A]] + case _ => throw new Error("OptionalImplicit should be always available") + } + } case Unseal(MethodCall(lhs, "&&", tpes, Some(List(rhs)))) if isBool(lhs) => val span = getSpan(rhs)