Skip to content

Commit

Permalink
Avoid jpath in example (#20775)
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha authored Jun 25, 2024
2 parents 4ff676e + 2c7d497 commit 3bd31c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/_docs/reference/metaprogramming/reflection.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def macroImpl()(quotes: Quotes): Expr[Unit] =
import quotes.reflect.*
val pos = Position.ofMacroExpansion

val path = pos.sourceFile.jpath.toString
val jpath = pos.sourceFile.getJPath.getOrElse(report.errorAndAbort("virtual file not supported", pos))
val path = pos.sourceFile.path // fallback for a virtual file
val start = pos.start
val end = pos.end
val startLine = pos.startLine
Expand Down
3 changes: 2 additions & 1 deletion docs/_spec/TODOreference/metaprogramming/reflection.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def macroImpl()(quotes: Quotes): Expr[Unit] =
import quotes.reflect.*
val pos = Position.ofMacroExpansion

val path = pos.sourceFile.jpath.toString
val jpath = pos.sourceFile.getJPath.getOrElse(report.errorAndAbort("virtual file not supported", pos))
val path = pos.sourceFile.path // fallback for a virtual file
val start = pos.start
val end = pos.end
val startLine = pos.startLine
Expand Down

0 comments on commit 3bd31c0

Please sign in to comment.