Skip to content

Commit bbe8e3f

Browse files
authored
Fix NullPointerException when using sourcecode.File in Scala 3 repl (#161)
In analogy to #153 fixes a NullPointerException when using `sourcecode.File` in the REPL.
1 parent a423594 commit bbe8e3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sourcecode/src-3/sourcecode/Macros.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ object Macros {
147147

148148
def fileImpl(using Quotes): Expr[sourcecode.File] = {
149149
import quotes.reflect._
150-
val file = quotes.reflect.Position.ofMacroExpansion.sourceFile.jpath.toAbsolutePath.toString
150+
val file = quotes.reflect.Position.ofMacroExpansion.sourceFile.path
151151
'{sourcecode.File(${Expr(file)})}
152152
}
153153

0 commit comments

Comments
 (0)