Files
kotlin-fork/compiler/testData/diagnostics/testsWithExplicitApi/properties.kt
T
Leonid Startsev 3b100e57f2 Change NO_EXPLICIT_VISIBILITY_IN_API_MODE diagnostic range to 'declaration modifiers + name'.
Motivation: missing visibility modifier is an error in visibility modifiers list, so we should highlight this list.
Including a name in the range is convenient for using alt+enter (you don't have to move cursor from name to fun/class/val keyword)

 Also change NO_EXPLICIT_RETURN_TYPE_IN_API_MODE diagnostic range to 'declaration name' to match corresponding IDE inspection.

Fix stylistic problems and typos after review
2019-11-06 19:54:00 +03:00

20 lines
618 B
Kotlin
Vendored

// SKIP_TXT
public class Foo(<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>val bar<!>: Int, private var bar2: String, internal var bar3: Long, public var bar4: Int) {
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>var simple<!>: Int = 10
public var simple2: Int = 10
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>val withGetter<!>: Int
get() = 10
public val withGetter2: Int
get() = 10
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>var getterAndSetter<!>: Int = 10
get() = field
set(v) { field = v }
public var getterAndSetter2: Int = 10
get() = field
set(v) { field = v }
}