diff --git a/compiler/src/dotty/tools/dotc/typer/Inliner.scala b/compiler/src/dotty/tools/dotc/typer/Inliner.scala index 45e33741172f..284fe5f9cf2a 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inliner.scala @@ -817,7 +817,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) { newOwners = ctx.owner :: Nil, substFrom = ddef.vparamss.head.map(_.symbol), substTo = argSyms) - Inlined(ddef, bindingsBuf.toList, expander.transform(ddef.rhs)) + Block(bindingsBuf.toList, expander.transform(ddef.rhs)) case _ => tree } case _ => tree diff --git a/tests/pos-macros/i7342/Macro_1.scala b/tests/pos-macros/i7342/Macro_1.scala new file mode 100644 index 000000000000..dcbeb4759678 --- /dev/null +++ b/tests/pos-macros/i7342/Macro_1.scala @@ -0,0 +1,5 @@ +import scala.quoted.{ QuoteContext, Expr } + +trait Foo + +inline def g(em: Expr[Foo])(using QuoteContext) = '{$em} diff --git a/tests/pos-macros/i7342/Macro_2.scala b/tests/pos-macros/i7342/Macro_2.scala new file mode 100644 index 000000000000..e51a08189301 --- /dev/null +++ b/tests/pos-macros/i7342/Macro_2.scala @@ -0,0 +1,3 @@ +import scala.quoted.{ QuoteContext, Expr } + +def h(m: Expr[Foo])(using QuoteContext): Expr[Any] = g(m) diff --git a/tests/pos/i7342/First_1.scala b/tests/pos/i7342/First_1.scala new file mode 100644 index 000000000000..94e7c0cf281c --- /dev/null +++ b/tests/pos/i7342/First_1.scala @@ -0,0 +1 @@ +inline def g(em: Int) = ((c: Int) => em).apply({println("AAAAAAA"); 1}) diff --git a/tests/pos/i7342/Second_2.scala b/tests/pos/i7342/Second_2.scala new file mode 100644 index 000000000000..e207ccd59ff0 --- /dev/null +++ b/tests/pos/i7342/Second_2.scala @@ -0,0 +1 @@ +def h(m: Int) = g(m)