diff --git a/compiler/src/dotty/tools/dotc/transform/Splicer.scala b/compiler/src/dotty/tools/dotc/transform/Splicer.scala index 704c44f41a1c..3901509a07f1 100644 --- a/compiler/src/dotty/tools/dotc/transform/Splicer.scala +++ b/compiler/src/dotty/tools/dotc/transform/Splicer.scala @@ -356,7 +356,7 @@ object Splicer { interpretTree(expr)(newEnv) case NamedArg(_, arg) => interpretTree(arg) - case Inlined(EmptyTree, Nil, expansion) => interpretTree(expansion) + case Inlined(_, Nil, expansion) => interpretTree(expansion) case Typed(expr, _) => interpretTree(expr) diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index 9fbdcbbc0606..073200825e16 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -710,6 +710,8 @@ trait Checking { tree match { case Typed(expr, _) => checkInlineConformant(expr, isFinal, what) + case Inlined(_, Nil, expr) => + checkInlineConformant(expr, isFinal, what) case SeqLiteral(elems, _) => elems.foreach(elem => checkInlineConformant(elem, isFinal, what)) case Apply(fn, List(arg)) if defn.WrapArrayMethods().contains(fn.symbol) => diff --git a/tests/pos/inlined-inline-param.scala b/tests/pos/inlined-inline-param.scala new file mode 100644 index 000000000000..14df79b9df98 --- /dev/null +++ b/tests/pos/inlined-inline-param.scala @@ -0,0 +1,4 @@ +class Foo { + inline def foo(inline x: Int): Int = x + def bar: Int = foo(foo(4)) +} diff --git a/tests/run-with-compiler/reflect-inline/assert_1.scala b/tests/run-with-compiler/reflect-inline/assert_1.scala index f653c220e62c..020b7379977b 100644 --- a/tests/run-with-compiler/reflect-inline/assert_1.scala +++ b/tests/run-with-compiler/reflect-inline/assert_1.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.tasty._ object api { - inline def (inline x: String) stripMargin <: String = + inline def (inline x: String) stripMargin: String = ${ stripImpl(x) } private def stripImpl(x: String)(implicit refl: Reflection): Expr[String] =