Skip to content

Commit 4c51bc3

Browse files
committed
Use correct API ctx.source
1 parent 7850b1e commit 4c51bc3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ object Inliner {
152152
if (enclosingInlineds.nonEmpty) inlined // Remove in the outer most inlined call
153153
else {
154154
val inlinedAtPos = inlined.call.pos
155+
val callSourceFile = ctx.source.file
155156

156157
/** Removes all Inlined trees, replacing them with blocks.
157158
* Repositions all trees directly inside an inlined expansion of a non empty call to the position of the call.
@@ -164,7 +165,7 @@ object Inliner {
164165
case _ =>
165166
val transformed = super.transform(tree)
166167
enclosingInlineds match {
167-
case call :: _ if call.symbol.sourceFile != ctx.owner.sourceFile =>
168+
case call :: _ if call.symbol.sourceFile != callSourceFile =>
168169
// Until we implement JSR-45, we cannot represent in output positions in other source files.
169170
// So, reposition inlined code from other files with the call position:
170171
transformed.withPos(inlinedAtPos)

0 commit comments

Comments
 (0)