mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Reuse existing (but not used) VALUE_PARAMETER_AS_PROPERTY in BindingContext to store mapping from constructor's value parameters to property descriptors. Create a new slice DATA_CLASS_COMPONENT_FUNCTION to store mapping from constructor's value parameters to generated componentN functions.
12 lines
308 B
Kotlin
12 lines
308 B
Kotlin
open data class A(val x: Int, val y: String)
|
|
|
|
class B : A(42, "OK") {
|
|
<!OVERRIDING_FINAL_MEMBER!>override<!> fun component1(): Int = 21
|
|
<!OVERRIDING_FINAL_MEMBER!>override<!> fun component2(): <!RETURN_TYPE_MISMATCH_ON_OVERRIDE!>Int<!> = 21
|
|
}
|
|
|
|
fun foo(b: B) {
|
|
b.component1()
|
|
b.component2()
|
|
}
|