File tree 3 files changed +5
-4
lines changed
tasty-getfile-implicit-fun-context
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 =>
440
440
// ////////////
441
441
442
442
/** 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
444
445
445
446
extension ContextOps on (self : Context ) {
446
447
/** Returns the owner of the context */
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ object SourceFiles {
11
11
12
12
def getThisFileImpl : Macro [String ] = {
13
13
val qctx = tastyContext
14
- import qctx .tasty .{ _ , given _ }
14
+ import qctx .tasty ._
15
15
rootContext.source.getFileName.toString
16
16
}
17
17
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ object SourceFiles {
8
8
$ {getThisFileImpl}
9
9
10
10
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
13
13
}
14
14
15
15
}
You can’t perform that action at this time.
0 commit comments