Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/dotc/inlines/Inliner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,8 @@ class Inliner(val call: tpd.Tree)(using Context):
tree match {
case tree: RefTree if tree.isTerm && level == -1 && tree.symbol.isDefinedInCurrentRun && !tree.symbol.isLocal =>
foldOver(tree.symbol :: syms, tree)
case _: This if level == -1 && tree.symbol.isDefinedInCurrentRun =>
tree.symbol :: syms
case _: TypTree => syms
case _ => foldOver(syms, tree)
}
Expand Down
8 changes: 8 additions & 0 deletions tests/pos-macros/i18393/Inline_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package user

import defn.Macro

object Inline extends Macro {
inline def callMacro(): Int =
${ this.impl() }
}
7 changes: 7 additions & 0 deletions tests/pos-macros/i18393/Macro_1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package defn

import scala.quoted.*

abstract class Macro {
def impl()(using Quotes): Expr[Int] = '{1}
}
5 changes: 5 additions & 0 deletions tests/pos-macros/i18393/Test_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package user

object Test {
Inline.callMacro()
}