-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add missing -Yexplicit-nulls for presentation compiler #18776
Add missing -Yexplicit-nulls for presentation compiler #18776
Conversation
4da9ce8
to
7136850
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly very minor stuff, though I don't love that we need to do nn on everything coming from Java :/ Using project Lombok would help at some point?
presentation-compiler/src/main/dotty/tools/pc/AutoImports.scala
Outdated
Show resolved
Hide resolved
presentation-compiler/src/main/dotty/tools/pc/ConvertToNamedArgumentsProvider.scala
Outdated
Show resolved
Hide resolved
presentation-compiler/src/main/dotty/tools/pc/HoverProvider.scala
Outdated
Show resolved
Hide resolved
presentation-compiler/src/main/dotty/tools/pc/HoverProvider.scala
Outdated
Show resolved
Hide resolved
presentation-compiler/src/main/dotty/tools/pc/PcInlineValueProviderImpl.scala
Outdated
Show resolved
Hide resolved
presentation-compiler/src/main/dotty/tools/pc/PcInlineValueProviderImpl.scala
Outdated
Show resolved
Hide resolved
presentation-compiler/src/main/dotty/tools/pc/completions/CompletionProvider.scala
Show resolved
Hide resolved
presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala
Outdated
Show resolved
Hide resolved
presentation-compiler/src/main/dotty/tools/pc/completions/InterpolatorCompletions.scala
Outdated
Show resolved
Hide resolved
Well, this is a tradeoff of having crashes from working on untyped trees as on typed ones, which are significantly harder to debug than simple null pointer assertion failure. They will also fail fast instead of some deeper place in the code. The cost of this is the |
1ce3c5a
to
1016d16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
With a new definition of untyped trees, it is now required to have `-Yexplicit-nulls` flag in modules that use them in order to have proper type checking. This PR adds the missing flag. Without the flag, it was possible to first assign untyped trees to typed trees, and secondly use extension methods for typed trees which can be seen at `KeywordsCompletions.scala` with usage of `untpdTree.filterSubtrees`. It is also blocked by: #18775 I can also make a workaround in the unmanaged module, but it will require a dependency on nightly version / a new release from metals. [Cherry-picked e149e4c]
With a new definition of untyped trees, it is now required to have
-Yexplicit-nulls
flag in modules that use them in order to have proper type checking. This PR adds the missing flag.Without the flag, it was possible to first assign untyped trees to typed trees, and secondly use extension methods for typed trees which can be seen at
KeywordsCompletions.scala
with usage ofuntpdTree.filterSubtrees
.It is also blocked by: #18775
I can also make a workaround in the unmanaged module, but it will require a dependency on nightly version / a new release from metals.