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 @@ -452,7 +452,8 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
452
452
// ////////////
453
453
454
454
/** Context of the macro expansion */
455
- given rootContext as Context = internal.rootContext // TODO: Use given // TODO: Should this be moved to QuoteContext?
455
+ def rootContext : Context = internal.rootContext // TODO: Should this be moved to QuoteContext?
456
+ given Context = rootContext // TODO: Should be an implicit converion from QuoteContext to Context
456
457
457
458
extension ContextOps on (self : Context ) {
458
459
/** 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