diff --git a/library/src/scala/tasty/Reflection.scala b/library/src/scala/tasty/Reflection.scala index 4b8c66ddc259..a2917c0717c8 100644 --- a/library/src/scala/tasty/Reflection.scala +++ b/library/src/scala/tasty/Reflection.scala @@ -452,7 +452,8 @@ class Reflection(private[scala] val internal: CompilerInterface) { self => ////////////// /** Context of the macro expansion */ - given rootContext as Context = internal.rootContext // TODO: Use given // TODO: Should this be moved to QuoteContext? + def rootContext: Context = internal.rootContext // TODO: Should this be moved to QuoteContext? + given Context = rootContext // TODO: Should be an implicit converion from QuoteContext to Context extension ContextOps on (self: Context) { /** Returns the owner of the context */ diff --git a/tests/run-macros/tasty-getfile-implicit-fun-context/Macro_1.scala b/tests/run-macros/tasty-getfile-implicit-fun-context/Macro_1.scala index e24c79f82df8..0fa79b566316 100644 --- a/tests/run-macros/tasty-getfile-implicit-fun-context/Macro_1.scala +++ b/tests/run-macros/tasty-getfile-implicit-fun-context/Macro_1.scala @@ -11,7 +11,7 @@ object SourceFiles { def getThisFileImpl: Macro[String] = { val qctx = tastyContext - import qctx.tasty.{_, given _} + import qctx.tasty._ rootContext.source.getFileName.toString } diff --git a/tests/run-macros/tasty-getfile/Macro_1.scala b/tests/run-macros/tasty-getfile/Macro_1.scala index 1a67e515e427..2d517795989b 100644 --- a/tests/run-macros/tasty-getfile/Macro_1.scala +++ b/tests/run-macros/tasty-getfile/Macro_1.scala @@ -8,8 +8,8 @@ object SourceFiles { ${getThisFileImpl} private def getThisFileImpl(using qctx: QuoteContext) : Expr[String] = { - import qctx.tasty.{_, given _} - rootContext.source.getFileName.toString + import qctx.tasty._ + summon[Context].source.getFileName.toString } }