Add inspection to detect non-const vals used as Java annotation args

So #KT-20615 Fixed
This commit is contained in:
Mikhail Glukhikh
2017-12-14 12:51:19 +03:00
parent 70b7e5eb68
commit 7358980cbc
16 changed files with 215 additions and 24 deletions
@@ -0,0 +1,20 @@
<problems>
<problem>
<file>JavaUser.java</file>
<line>3</line>
<module>First</module>
<package>&lt;default&gt;</package>
<entry_point TYPE="file" FQNAME="file://C:/Users/Mikhail.Glukhikh/AppData/Local/Temp/unitTest_fakeJvmFieldConstant_FakeJvmFieldConstant/unitTest1/First/src/JavaUser.java" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Kotlin non-const property used as annotation argument</problem_class>
<description>Use of @JvmField non-const Kotlin property as annotation argument is incorrect. Will be forbidden in 1.3</description>
</problem>
<problem>
<file>JavaUser.java</file>
<line>7</line>
<module>First</module>
<package>&lt;default&gt;</package>
<entry_point TYPE="file" FQNAME="file://C:/Users/Mikhail.Glukhikh/AppData/Local/Temp/unitTest_fakeJvmFieldConstant_FakeJvmFieldConstant/unitTest1/First/src/JavaUser.java" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Kotlin non-const property used as annotation argument</problem_class>
<description>Use of @JvmField non-const Kotlin property as annotation argument is incorrect. Will be forbidden in 1.3</description>
</problem>
</problems>