Fix for a bug that caused invalid code generated for calling extension from another extension.

This commit is contained in:
Pavel V. Talanov
2012-07-31 13:15:12 +04:00
parent 7609d0de8c
commit e0ff877b47
6 changed files with 70 additions and 4 deletions
@@ -0,0 +1,17 @@
package foo
open class A() {
open fun c() = 2
}
class B(): A() {
override fun c() = 3
}
fun B.t() = d() + 1
fun A.d() = c() + 3
fun box() : Boolean {
return A().d() == 5 && B().d() == 6 && B().t() == 7
}
@@ -0,0 +1,7 @@
package foo
fun <T> T.toPrefixedString(prefix: String = "", suffix: String="") = prefix + toString() + suffix
fun box() : Boolean {
return ("mama".toPrefixedString(suffix="321", prefix="papa") == "papamama321")
}
@@ -0,0 +1,14 @@
package foo
open class A() {
open fun c() = 2
}
class B(): A() {
}
fun B.d() = c() + 3
fun box() : Boolean {
return B().d() == 5
}