Skip to content

Release flag doesn't make compiler suggest correct completions #18726

Closed
@tgodzik

Description

@tgodzik

Compiler version

3.3.1

with -release 8

Minimized code

"hello, world".@@

Output

Compiler will suggest completions from the current JDK and not from the JDK API. If Metals is running on JDK 11 it will still suggest repeat method which only was added in JDK 11

Expectation

This works in Scala 2, but I am not exactly sure what we would need to migrate. @SethTisue suggested this is connected to JRT.

The only thing I found that seemed related was https://github.com/scala/scala/blob/bf45e199e96383b96a6955520d7d2524c78e6e12/src/compiler/scala/tools/nsc/Global.scala#L149

So I guess the default classpath is replaced by the jrt one if release flag ispresent? This must already work to some extend in Dotty since that flag works reporting compilation errors.

Metadata

Metadata

Assignees

Labels

area:presentation-compilerRelated to the presentation compiler module used by Metals and possibly other toolsitype:bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions