FIR: don't report CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT on variables

This commit is contained in:
Mikhail Glukhikh
2021-03-04 11:56:19 +03:00
parent dd3bc1a964
commit d7a6fc80b0
5 changed files with 7 additions and 9 deletions
@@ -12,7 +12,7 @@ object A {
const val inObject: Int = 4
}
class B(<!CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT!>const<!> val constructor: Int = 5)
class B(const val constructor: Int = 5)
abstract class C {
<!INCOMPATIBLE_MODIFIERS!>open<!> <!CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT, INCOMPATIBLE_MODIFIERS!>const<!> val x: Int = 6
@@ -48,7 +48,7 @@ const val withExplicitDefaultGetter: Int = 1
get
fun foo(): Int {
<!CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT!>const<!> val local: Int = 14
const val local: Int = 14
return 15
}