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

Scala 3: Cannot invoke "java.nio.file.Path.getFileName()" #125

Closed
darkfrog26 opened this issue Feb 5, 2023 · 2 comments
Closed

Scala 3: Cannot invoke "java.nio.file.Path.getFileName()" #125

darkfrog26 opened this issue Feb 5, 2023 · 2 comments
Milestone

Comments

@darkfrog26
Copy link

On Scala 3, running in the SBT REPL, I'm able to reproduce this issue:

Exception occurred while executing macro expansion.
   java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.getFileName()" because the return value of "scala.quoted.Quotes$reflectModule$SourceFileMethods.jpath(Object)" is null
   	at sourcecode.Macros$.fileNameImpl(Macros.scala:155)

See outr/scribe#397 for reference

@darkfrog26
Copy link
Author

Ping! Any updates on this?

hearnadam added a commit to hearnadam/kyo that referenced this issue Apr 13, 2024
- Custom macro uses opaque type, avoiding allocations
- Combining filename and line number should reduce IOs to only capture one pointer
- Remove dependency on com.lihaoyi.sourcecode
  - note: this also means kyo now should work better in worksheets/consoles com-lihaoyi/sourcecode#125
lihaoyi pushed a commit that referenced this issue Apr 15, 2024
#125

Wasn't able to run tests locally - kept seeing failures with mill
script.
@lihaoyi
Copy link
Member

lihaoyi commented Apr 15, 2024

Fixed by #153

@lihaoyi lihaoyi closed this as completed Apr 15, 2024
@lefou lefou added this to the 0.4.1 milestone Apr 16, 2024
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

No branches or pull requests

3 participants