SonarLint plugin for IntelliJ detects errors as expected for the following code in Java:
public class Test {
private String CONST = “Constant”;
}
The same code in Kotlin generates no errors:
class TestKotlinn {
private val CONST = “Constant”;
}
[Note] This is not a test class, it’s just a standard class containing no other code.
Expected: SonarLint for Kotlin should say “Remove the unused CONST private field” the same way it does for Java, and also the same way IntelliJ shows a warning.
IntelliJ version: IntelliJ IDEA 2018.2.6 (Ultimate Edition), Build #IU-182.5107.16, built on November 6, 2018
JRE: 1.8.0_152-release-1248-b22 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
OS: macOS 10.13.6
SonarLint IntelliJ plugin: Version: 4.0.0.2916
Screenshots (link to a Tweet): https://twitter.com/dmahmudiev/status/1064927781342064640