Fix mapGetterSignature/mapSetterSignature
In case of TRAIT_IMPL the incorrect this was written. Reuse the code from the common mapSignature #KT-3413 Fixed
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
abstract class Base<T> {
|
||||
abstract var s: T
|
||||
}
|
||||
|
||||
trait Trait<T> : Base<T> {
|
||||
var value : T
|
||||
get() = s
|
||||
set(value) { s = value }
|
||||
}
|
||||
|
||||
class Derived : Trait<String>, Base<String>() {
|
||||
override var s = "Fail"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val d = Derived()
|
||||
d.value = "OK"
|
||||
return d.value
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
open class Base {
|
||||
var s = "Fail"
|
||||
}
|
||||
|
||||
trait Trait : Base {
|
||||
var value : String
|
||||
get() = s
|
||||
set(value) { s = value }
|
||||
}
|
||||
|
||||
class Derived : Trait, Base()
|
||||
|
||||
fun box(): String {
|
||||
val d = Derived()
|
||||
d.value = "OK"
|
||||
return d.value
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
open class Base
|
||||
|
||||
trait Trait : Base {
|
||||
private val value : String
|
||||
get() = "OK"
|
||||
|
||||
fun toString() = object {
|
||||
fun foo() = value
|
||||
}.foo()
|
||||
}
|
||||
|
||||
class Derived : Trait, Base()
|
||||
|
||||
fun box() = "${Derived()}"
|
||||
Reference in New Issue
Block a user