FIR checker/IDE: Add checker and quickfix for WRONG_MODIFIER_TARGET.

There are only simple checks for `external` and `const` for now. The
rest of the checks (see ModifiersChecker in FE1.0) will be added later.
This commit is contained in:
Mark Punzalan
2021-03-03 20:34:03 +00:00
committed by Ilya Kirillov
parent ebfc431733
commit c3d2ce0c1f
22 changed files with 138 additions and 20 deletions
@@ -4,7 +4,7 @@ import kotlin.reflect.KProperty
const val topLevel: Int = 0
const val topLevelInferred = 1
const var topLeveLVar: Int = 2
<!WRONG_MODIFIER_TARGET!>const<!> var topLeveLVar: Int = 2
private val privateTopLevel = 3
@@ -12,6 +12,6 @@ const val arrayConst: Array<String> = arrayOf("1")
const val intArrayConst: IntArray = intArrayOf()
const val unresolvedConst1 = <!UNRESOLVED_REFERENCE!>Unresolved<!>
const var unresolvedConst2 = <!UNRESOLVED_REFERENCE!>Unresolved<!>
<!WRONG_MODIFIER_TARGET!>const<!> var unresolvedConst2 = <!UNRESOLVED_REFERENCE!>Unresolved<!>
const val unresolvedConst3 = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD, UNRESOLVED_REFERENCE!>Unresolved<!>
get() = 10