Can be primary constructor property: check whether property belongs to the same class #KT-12876 Fixed
(cherry picked from commit eb05a7a)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
e492d23d58
commit
51ccfc120e
@@ -31,4 +31,17 @@ class Incorrect(val property: String, withGetter: Double, withSetter: Int, diffe
|
||||
// For data class inspection also should not work
|
||||
data class Data(name: String) {
|
||||
val name = name
|
||||
}
|
||||
|
||||
// Case from KT-12876: also should not work, property lives in different class here
|
||||
interface Foo {
|
||||
val x : String
|
||||
}
|
||||
|
||||
class Bar(x : String) {
|
||||
init {
|
||||
object : Foo {
|
||||
override val x = x // Property is assigned to parameter, can be declared in ctor
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user