File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
tasty-getfile-implicit-fun-context Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -440,7 +440,8 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
440440 // ////////////
441441
442442 /** Context of the macro expansion */
443- given rootContext as Context = internal.rootContext // TODO: Use given // TODO: Should this be moved to QuoteContext?
443+ def rootContext : Context = internal.rootContext // TODO: Should this be moved to QuoteContext?
444+ given Context = rootContext // TODO: Should be an implicit converion from QuoteContext to Context
444445
445446 extension ContextOps on (self : Context ) {
446447 /** Returns the owner of the context */
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ object SourceFiles {
1111
1212 def getThisFileImpl : Macro [String ] = {
1313 val qctx = tastyContext
14- import qctx .tasty .{ _ , given _ }
14+ import qctx .tasty ._
1515 rootContext.source.getFileName.toString
1616 }
1717
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ object SourceFiles {
88 $ {getThisFileImpl}
99
1010 private def getThisFileImpl (using qctx : QuoteContext ) : Expr [String ] = {
11- import qctx .tasty .{ _ , given _ }
12- rootContext .source.getFileName.toString
11+ import qctx .tasty ._
12+ summon[ Context ] .source.getFileName.toString
1313 }
1414
1515}
You can’t perform that action at this time.
0 commit comments