Support destructuring in lambda parameters (KT-14422) and skipping some components in a destructuring declaration (KT-14507).
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// TODO: enable JS backend when issue KT-14535 is fixed
|
||||
// TARGET_BACKEND: JVM
|
||||
class A {
|
||||
operator fun component1() = 1
|
||||
operator fun component2() = 2
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// TODO: enable JS backend when issue KT-14535 is fixed
|
||||
// TARGET_BACKEND: JVM
|
||||
class A {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// TODO: enable JS backend when issue KT-14535 is fixed
|
||||
// TARGET_BACKEND: JVM
|
||||
class A {
|
||||
operator fun component1() = 1
|
||||
operator fun component2() = 2
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ class S(val a: String, val b: String) {
|
||||
operator fun component2() : String = b
|
||||
}
|
||||
|
||||
operator fun S.component3() = ((a + b) as java.lang.String).substring(2)
|
||||
operator fun S.component3() = ((a + b) as String).substring(2)
|
||||
|
||||
class Tester() {
|
||||
fun box() : String {
|
||||
@@ -11,7 +11,7 @@ class Tester() {
|
||||
return o + k + ok + ok2
|
||||
}
|
||||
|
||||
operator fun S.component4() = ((a + b) as java.lang.String).substring(2)
|
||||
operator fun S.component4() = ((a + b) as String).substring(2)
|
||||
}
|
||||
|
||||
fun box() = Tester().box()
|
||||
Reference in New Issue
Block a user