From 058105b07f8ba2f650ff83496a9b7edb6e5bf93e Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 11 Jul 2019 13:49:46 +0200 Subject: [PATCH] Fix #5547: Add regression test The preciseness of the error message was already improved in #6804. --- tests/pos/i5547.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/pos/i5547.scala diff --git a/tests/pos/i5547.scala b/tests/pos/i5547.scala new file mode 100644 index 000000000000..b62c0fa07982 --- /dev/null +++ b/tests/pos/i5547.scala @@ -0,0 +1,12 @@ +import scala.quoted._ + +object scalatest { + inline def assert1(condition: => Boolean): Unit = + ${assertImpl('condition, '{""})} + + inline def assert2(condition: => Boolean): Unit = + ${ assertImpl('condition, "".toExpr) } + + def assertImpl(condition: Expr[Boolean], clue: Expr[Any]) given QuoteContext: Expr[Unit] = + '{} +}