diff --git a/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala b/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala index 1e5b3ce3..b5abce2b 100644 --- a/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala +++ b/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala @@ -15,7 +15,9 @@ object MacroCompat { def locationImpl()(using Quotes): Expr[Location] = { import quotes.reflect._ val pos = Position.ofMacroExpansion - val path = pos.sourceFile.jpath.toString + val path = pos.sourceFile.getJPath + .map(_.toString()) + .getOrElse(pos.sourceFile.path) val startLine = pos.startLine + 1 '{ new Location(${ Expr(path) }, ${ Expr(startLine) }) } }