diff --git a/tests/pos/i8581/Macro_1.scala b/tests/pos/i8581/Macro_1.scala new file mode 100644 index 000000000000..62bb18d97f7d --- /dev/null +++ b/tests/pos/i8581/Macro_1.scala @@ -0,0 +1,11 @@ +import scala.quoted.* + +case class Position() +object Position { + implicit inline def here: Position = ${ genPosition } + + private def genPosition(using Quotes): Expr[Position] = { + val lineNo: Int = quotes.reflect.Position.ofMacroExpansion.startLine + '{ Position() } + } +} diff --git a/tests/pos/i8581/Test_2.scala b/tests/pos/i8581/Test_2.scala new file mode 100644 index 000000000000..1d699b7db1dd --- /dev/null +++ b/tests/pos/i8581/Test_2.scala @@ -0,0 +1,16 @@ +import scala.concurrent.duration.FiniteDuration +import scala.language.implicitConversions +import scala.reflect.ClassTag + +class AnyShouldWrapper[T] + +class Test { + implicit def convertToAnyShouldWrapper[T](o: T)(implicit pos: Position): AnyShouldWrapper[T] = ??? + + def expectMsgType[T](implicit t: ClassTag[T]): T = ??? + def expectMsgType[T](max: FiniteDuration)(implicit t: ClassTag[T]): T = ??? + + def test(): Unit = { + expectMsgType[Int]: AnyShouldWrapper[Int] + } +}