File tree 2 files changed +4
-2
lines changed
_docs/reference/metaprogramming
_spec/TODOreference/metaprogramming
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ def macroImpl()(quotes: Quotes): Expr[Unit] =
82
82
import quotes .reflect .*
83
83
val pos = Position .ofMacroExpansion
84
84
85
- val path = pos.sourceFile.jpath.toString
85
+ val jpath = pos.sourceFile.getJPath.getOrElse(report.errorAndAbort(" virtual file not supported" , pos))
86
+ val path = pos.sourceFile.path // fallback for a virtual file
86
87
val start = pos.start
87
88
val end = pos.end
88
89
val startLine = pos.startLine
Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ def macroImpl()(quotes: Quotes): Expr[Unit] =
82
82
import quotes .reflect .*
83
83
val pos = Position .ofMacroExpansion
84
84
85
- val path = pos.sourceFile.jpath.toString
85
+ val jpath = pos.sourceFile.getJPath.getOrElse(report.errorAndAbort(" virtual file not supported" , pos))
86
+ val path = pos.sourceFile.path // fallback for a virtual file
86
87
val start = pos.start
87
88
val end = pos.end
88
89
val startLine = pos.startLine
You can’t perform that action at this time.
0 commit comments