Change Signature: Support conversion between extension and non-extension functions

This commit is contained in:
Alexey Sedunov
2014-12-19 20:40:17 +03:00
parent b31da56e09
commit 96866a108f
82 changed files with 1425 additions and 64 deletions
@@ -0,0 +1,19 @@
class A(val k: Int) {
fun X.<caret>foo(s: String, n: Int): Boolean {
return s.length() * this.k - n.inc() + this@A.k > 0
}
fun test() {
X(0).foo("1", 2)
}
}
class X(val k: Int)
fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
fun test() {
with(A(3)) {
X(0).foo("1", 2)
}
}