Incorrect warning about unused import when that import
references a nested class in the same file
is used only in a permits clause on the file's top-level class
Environment
Operating System: Win10
JDK version: 21
Visual Studio Code version: 1.85
Java extension version: v1.26.2023122208
Steps To Reproduce
The following code issues a warning in the IDE about unused imports:
package foo.x;
// these imports are warned against as unused,
// but the permits clause doesn't compile without them
import foo.x.A.B;
import foo.x.A.C;
public sealed interface A permits B, C {
record B(int data) implements A {}
record C(String data) implements A {}
}
Incorrect warning about unused import when that import
Environment
Steps To Reproduce
The following code issues a warning in the IDE about unused imports:
Current Result
warning on the import of foo.x.A.B and foo.x.A.C
Expected Result
no warnings
Additional Informations