Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location macro throws NPE for in-memory (virtual) source files #795

Closed
vasilmkd opened this issue Jun 18, 2024 · 1 comment · Fixed by #796
Closed

Location macro throws NPE for in-memory (virtual) source files #795

vasilmkd opened this issue Jun 18, 2024 · 1 comment · Fixed by #796

Comments

@vasilmkd
Copy link

Please read scala/scala3#20591 for the whole context.

Expanding the Location macro for in-memory source files throws a NullPointerException.

Exception occurred while executing macro expansion. java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.toString()" because the return value of "scala.quoted.Quotes$reflectModule$SourceFileMethods.jpath(Object)" is null at munit.internal.MacroCompat$.locationImpl(MacroCompat.scala:18)

At the moment, this macro is written exactly the same as in the Scala 3 documentation.

Most likely, the macro implementation will have to be adjusted, for maximum compatibility.

@vasilmkd
Copy link
Author

Here is a local reproduction of the issue.

scala/scala3#20591 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant