7b4f781ea8
In init block or property initializers, for `val x` declared in primary constructor, `x` reference is now resolved to property, not to parameter. So we need two different scopes for primary constructor, one for 'pure' parameters and another one for all parameters, including val/var ones. #KT-42844 Fixed
8 lines
192 B
Kotlin
Vendored
8 lines
192 B
Kotlin
Vendored
sealed class My(open val x: Int?) {
|
|
init {
|
|
if (x != null) {
|
|
// Should be error: property is open
|
|
x.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
|
|
}
|
|
}
|
|
} |