[FE] Support functional literals with context receivers
This commit is contained in:
committed by
TeamCityServer
parent
e3f987459c
commit
16b976f0e0
+20
-6
@@ -1,6 +1,10 @@
|
||||
class Param
|
||||
class C
|
||||
class R
|
||||
class C {
|
||||
val c = 42
|
||||
}
|
||||
class R {
|
||||
val r = 42
|
||||
}
|
||||
|
||||
context(C)
|
||||
fun R.f1(g: context(C) R.(Param) -> Unit) {
|
||||
@@ -23,10 +27,20 @@ fun f4(g: context(C) () -> Unit) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val lf1: context(C) R.(Param) -> Unit = { _ -> }
|
||||
val lf2: context(C) (Param) -> Unit = { _ -> }
|
||||
val lf3: context(C) R.() -> Unit = { }
|
||||
val lf4: context(C) () -> Unit = { }
|
||||
val lf1: context(C) R.(Param) -> Unit = { _ ->
|
||||
r
|
||||
c
|
||||
}
|
||||
val lf2: context(C) (Param) -> Unit = { _ ->
|
||||
c
|
||||
}
|
||||
val lf3: context(C) R.() -> Unit = {
|
||||
r
|
||||
c
|
||||
}
|
||||
val lf4: context(C) () -> Unit = {
|
||||
c
|
||||
}
|
||||
|
||||
with(C()) {
|
||||
with(R()) {
|
||||
|
||||
+20
-6
@@ -1,6 +1,10 @@
|
||||
class Param
|
||||
class C
|
||||
class R
|
||||
class C {
|
||||
val c = 42
|
||||
}
|
||||
class R {
|
||||
val r = 42
|
||||
}
|
||||
|
||||
context(C)
|
||||
fun R.f1(g: context(C) R.(Param) -> Unit) {
|
||||
@@ -23,10 +27,20 @@ fun f4(g: context(C) () -> Unit) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val lf1: context(C) R.(Param) -> Unit = { _ -> }
|
||||
val lf2: context(C) (Param) -> Unit = { _ -> }
|
||||
val lf3: context(C) R.() -> Unit = { }
|
||||
val lf4: context(C) () -> Unit = { }
|
||||
val lf1: context(C) R.(Param) -> Unit = { _ ->
|
||||
r
|
||||
c
|
||||
}
|
||||
val lf2: context(C) (Param) -> Unit = { _ ->
|
||||
c
|
||||
}
|
||||
val lf3: context(C) R.() -> Unit = {
|
||||
r
|
||||
c
|
||||
}
|
||||
val lf4: context(C) () -> Unit = {
|
||||
c
|
||||
}
|
||||
|
||||
with(C()) {
|
||||
with(R()) {
|
||||
|
||||
+2
@@ -8,6 +8,7 @@ public fun R.f3(/*0*/ g: @kotlin.ContextFunctionTypeParams(count = 1) (R.() -> k
|
||||
|
||||
public final class C {
|
||||
public constructor C()
|
||||
public final val c: kotlin.Int = 42
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
@@ -22,6 +23,7 @@ public final class Param {
|
||||
|
||||
public final class R {
|
||||
public constructor R()
|
||||
public final val r: kotlin.Int = 42
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
Reference in New Issue
Block a user