Skip to content

Commit d329ef6

Browse files
committed
Fix context in inline rhs generation in export forwarders
1 parent d87bbb1 commit d329ef6

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1351,8 +1351,8 @@ class Namer { typer: Typer =>
13511351
// Eagerly make the body inlineable. `registerInlineInfo` does this lazily
13521352
// but it does not get evaluated during typer as the forwarder we are creating
13531353
// is already typed.
1354-
val inlinableRhs = PrepareInlineable.makeInlineable(rhs)(using forwarderCtx)
1355-
PrepareInlineable.registerInlineInfo(forwarder, inlinableRhs)(using forwarderCtx)
1354+
val inlinableRhs = PrepareInlineable.makeInlineable(rhs)(using ctx)
1355+
PrepareInlineable.registerInlineInfo(forwarder, inlinableRhs)(using ctx)
13561356
inlinableRhs
13571357
else
13581358
rhs

tests/pos/i22593.scala

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import scala.quoted.*
2+
3+
package jam {
4+
trait JamCoreDsl {
5+
implicit inline def defaultJamConfig: this.JamConfig =
6+
new JamConfig(brewRecRegex = ".*")
7+
class JamConfig(val brewRecRegex: String)
8+
inline def brew(implicit inline config: JamConfig): Unit = ???
9+
}
10+
private object internal extends JamCoreDsl
11+
export internal._
12+
}
13+
14+
object test {
15+
jam.brew
16+
}

0 commit comments

Comments
 (0)