From 921b39fecb1e50276e6c6eee0ea848adda09af1b Mon Sep 17 00:00:00 2001 From: Adam Hearn <22334119+hearnadam@users.noreply.github.com> Date: Sat, 13 Apr 2024 15:27:17 -0700 Subject: [PATCH] Fix NullPointerException when using fileName under Scala 3 repl --- sourcecode/src-3/sourcecode/Macros.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sourcecode/src-3/sourcecode/Macros.scala b/sourcecode/src-3/sourcecode/Macros.scala index 69488c4..995f77e 100644 --- a/sourcecode/src-3/sourcecode/Macros.scala +++ b/sourcecode/src-3/sourcecode/Macros.scala @@ -152,7 +152,7 @@ object Macros { } def fileNameImpl(using Quotes): Expr[sourcecode.FileName] = { - val name = quotes.reflect.Position.ofMacroExpansion.sourceFile.jpath.getFileName.toString + val name = quotes.reflect.Position.ofMacroExpansion.sourceFile.name '{sourcecode.FileName(${Expr(name)})} }