Lambda --> reference supports bound references now #KT-13111 Fixed
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
class Owner(val z: Int) {
|
||||
// Possible only in 1.1 with bound references (this::foo)
|
||||
val x = { arg: Int <caret> -> foo(arg) }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
class Owner(val z: Int) {
|
||||
val x = this::foo
|
||||
}
|
||||
|
||||
fun Owner.foo(y: Int) = y + z
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
class Owner(val z: Int) {
|
||||
fun foo(y: Int) = y + z
|
||||
// Possible only in 1.1 with bound references (this::foo)
|
||||
val x = { arg: Int <caret> -> foo(arg) }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
class Owner(val z: Int) {
|
||||
fun foo(y: Int) = y + z
|
||||
val x = this::foo
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
class Owner(val z: Int) {
|
||||
fun foo(y: Int) = y + z
|
||||
}
|
||||
|
||||
val owner = Owner(42)
|
||||
|
||||
val x = { arg: Int <caret> -> owner.foo(arg) }
|
||||
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
class Owner(val z: Int) {
|
||||
fun foo(y: Int) = y + z
|
||||
}
|
||||
|
||||
val owner = Owner(42)
|
||||
|
||||
val x = owner::foo
|
||||
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
class Owner(val z: Int) {
|
||||
fun foo(y: Int) = y + z
|
||||
}
|
||||
|
||||
fun bar(owner: Owner) {
|
||||
val x = { arg: Int <caret> -> owner.foo(arg) }
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: true
|
||||
|
||||
class Owner(val z: Int) {
|
||||
fun foo(y: Int) = y + z
|
||||
}
|
||||
|
||||
fun bar(owner: Owner) {
|
||||
val x = owner::foo
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// IS_APPLICABLE: true
|
||||
// WITH_RUNTIME
|
||||
|
||||
class Owner(val z: Int) {
|
||||
fun foo(y: Int) = y + z
|
||||
val x = 7.let {<caret> foo(it) }
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// IS_APPLICABLE: true
|
||||
// WITH_RUNTIME
|
||||
|
||||
class Owner(val z: Int) {
|
||||
fun foo(y: Int) = y + z
|
||||
val x = 7.let(this::foo)
|
||||
}
|
||||
Reference in New Issue
Block a user