Extract Function: Fix 'this' label (extension case)

#KT-5456 Fixed
This commit is contained in:
Alexey Sedunov
2015-01-13 15:37:22 +03:00
parent 941e08b80f
commit d54b261c61
4 changed files with 42 additions and 2 deletions
@@ -0,0 +1,14 @@
// PARAM_TYPES: A
// PARAM_TYPES: B
// PARAM_DESCRIPTOR: internal final class A defined in root package
// PARAM_DESCRIPTOR: internal final fun B.foo(): Int defined in A
// SIBLING:
class A {
val a = 1
fun B.foo() = <selection>a + b</selection>
}
class B {
val b = 1
}
@@ -0,0 +1,18 @@
// PARAM_TYPES: A
// PARAM_TYPES: B
// PARAM_DESCRIPTOR: internal final class A defined in root package
// PARAM_DESCRIPTOR: internal final fun B.foo(): Int defined in A
// SIBLING:
class A {
val a = 1
fun B.foo() = i(this@A, this)
}
private fun i(a1: A, b: B): Int {
return a1.a + b.b
}
class B {
val b = 1
}