Skip to content

Commit 59a708e

Browse files
authored
Fix NullPointerException when using fileName under Scala 3 repl (#153)
#125 Wasn't able to run tests locally - kept seeing failures with mill script.
1 parent 5364af2 commit 59a708e

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
@@ -152,7 +152,7 @@ object Macros {
152152
}
153153

154154
def fileNameImpl(using Quotes): Expr[sourcecode.FileName] = {
155-
val name = quotes.reflect.Position.ofMacroExpansion.sourceFile.jpath.getFileName.toString
155+
val name = quotes.reflect.Position.ofMacroExpansion.sourceFile.name
156156
'{sourcecode.FileName(${Expr(name)})}
157157
}
158158

0 commit comments

Comments
 (0)