-
Notifications
You must be signed in to change notification settings - Fork 1.1k
jpath
in the reflection API can return null but this isn't documented anywhere
#13007
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
Comments
Looks like the same issue exists in munit: https://github.com/scalameta/munit/blob/be448cb039fee43a97b80c2b94cf89e2c39dba75/munit/shared/src/main/scala-3/munit/internal/MacroCompat.scala#L18 |
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 28, 2021
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 28, 2021
And deprecate SourceFile.jpath Fixes scala#13007
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 28, 2021
And deprecate SourceFile.jpath Fixes scala#13007
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 28, 2021
And deprecate SourceFile.jpath Fixes scala#13007
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 28, 2021
And deprecate SourceFile.jpath Fixes scala#13007
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 29, 2021
And deprecate SourceFile.jpath Fixes scala#13007
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 30, 2021
And deprecate SourceFile.jpath Fixes scala#13007
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 17, 2021
And deprecate SourceFile.jpath Fixes scala#13007
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jpath
in https://github.com/lampepfl/dotty/blob/147e9baf778a24f9f363ecf8e3898d69c40421ee/library/src/scala/quoted/Quotes.scala#L4154-L4155 is implemented asself.file.jpath
which can be null (for example when using the REPL becausefile
will be a VirtualFile).We should update the API documentation to mention this fact, but I think it'd be even better to deprecate this method and replace it by a method that returns an Option, this would avoid mistakes like https://github.com/scalatest/scalatest/blob/e6e656bac6e54be2a9ae4f286a3727714ac09d1e/dotty/core/src/main/scala/org/scalatest/AssertionsMacro.scala#L53 which lead to the scalatest assert macro throwing an NPE from the REPL:
The text was updated successfully, but these errors were encountered: