This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
Wrong highlighting on 'new' keyword on inner classes #228
Labels
Comments
The code does not compile, not an issue. |
It compiles. $> java -version
openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment Zulu14.28+21-CA (build 14.0.1+8)
OpenJDK 64-Bit Server VM Zulu14.28+21-CA (build 14.0.1+8, mixed mode, sharing)
$> tree
.
├── Foo$Bar.class
├── Foo.class
├── Foo.java
├── Main.class
└── Main.java
0 directories, 5 files
$> cat Foo.java
public class Foo {
public class Bar {
void run() {
System.out.println("It complies.");
}
}
}
$> cat Main.java
public class Main {
public static void main(String[] args) {
Foo foo = new Foo();
Foo.Bar bar = foo.new Bar();
bar.run();
}
}
$> java Main
It complies.
|
Is that OpenJDK 14? I compile on JDK 8, which is what we keep as a baseline. This is a new feature then. Please update the issue accordingly. |
Also, shouldn't it be like this? Foo.Bar example2 = new example1.Bar(); // <---- |
See https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html , section "Inner Classes".
It's strange, and I don't know why
|
Yeah, I came up with a working example, similar to your code. Looks like a bug. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
creating a new instance of an inner class doesn't highlight the
new
keyword properlyinner
Steps to Reproduce
Expected behavior:
keyword
new
is correctly highlighted.Actual behavior:
The text was updated successfully, but these errors were encountered: