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:
Alexander Udalov
2013-03-15 21:26:23 +04:00
parent 2518ba3353
commit 242b97febf
5 changed files with 69 additions and 39 deletions
@@ -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()}"