Object or top level property name warning


I get a warning when I start a private property name with an underscore in an Object.

object Foo {
private val _bar = 3 // Warning

Anybody know what the reasoning is?


Same as for any other naming conventions warning: the Kotlin style guide tells you not to use such names.


But as far as I know the convention when you have something like this is to use an underscore at the start of the name.

private val _list = mutableListOf(1, 2, 3)
val list: List<Int>
    get() = _list

How would one name the private backing field here?