Skip to content

Commit efcbfd5

Browse files
som-snyttWojciechMazur
authored andcommitted
Update docs/_spec/TODOreference/metaprogramming/reflection.md
Co-authored-by: Jamie Thompson <[email protected]> [Cherry-picked 2c7d497]
1 parent e4f8c45 commit efcbfd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: docs/_spec/TODOreference/metaprogramming/reflection.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def macroImpl()(quotes: Quotes): Expr[Unit] =
8282
import quotes.reflect.*
8383
val pos = Position.ofMacroExpansion
8484

85-
val path = pos.sourceFile.path
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
8687
val start = pos.start
8788
val end = pos.end
8889
val startLine = pos.startLine

0 commit comments

Comments
 (0)