diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 9f5c970f2fb0..b6379d7c8434 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -366,7 +366,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler if self.isExpr then Some(new ExprImpl(self, SpliceScope.getCurrent)) else None - def tpe: TypeRepr = self.tpe + def tpe: TypeRepr = self.tpe.widenSkolem def underlyingArgument: Term = new tpd.TreeOps(self).underlyingArgument def underlying: Term = new tpd.TreeOps(self).underlying def etaExpand(owner: Symbol): Term = self.tpe.widen match { diff --git a/tests/pos-macros/i9684/Macro_1.scala b/tests/pos-macros/i9684/Macro_1.scala new file mode 100644 index 000000000000..7b47efefdfd8 --- /dev/null +++ b/tests/pos-macros/i9684/Macro_1.scala @@ -0,0 +1,16 @@ +import scala.quoted._ + +object X { + + inline def printType[A](inline x: A): String = ${ + printTypeImpl[A]('x) + } + + def printTypeImpl[A:Type](x:Expr[A])(using Quotes): Expr[String] = { + import quotes.reflect._ + val value: String = x.asTerm.tpe.show + println(value) + Expr( value ) + } + +} diff --git a/tests/pos-macros/i9684/Test_2.scala b/tests/pos-macros/i9684/Test_2.scala new file mode 100644 index 000000000000..969c216ebe6e --- /dev/null +++ b/tests/pos-macros/i9684/Test_2.scala @@ -0,0 +1,7 @@ +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.language.postfixOps + +@main def Test: Unit = + val latch = Vector.fill(10)(Future successful 10) + X.printType( { Await.ready(latch(3) , 1 second) } )