FIR resolve: add partial support of extension lambda calls
Here we introduce ONLY_IMPLICIT_RECEIVER tower level to support extension lambda calls on local variables, and soften extension receiver checks to make such extensions visible & applicable. Also here we try to map arguments twice for functional types
This commit is contained in:
+7
-7
@@ -12,17 +12,17 @@ typealias XBar = Bar
|
||||
|
||||
typealias XXBar = XBar
|
||||
|
||||
fun Foo.foo(body: Foo.() -> Unit) = <!INAPPLICABLE_CANDIDATE!>body<!>()
|
||||
fun Foo.xbar(body: XBar.() -> Unit) = Bar().<!UNRESOLVED_REFERENCE!>body<!>()
|
||||
fun Foo.xxbar(body: XXBar.() -> Unit) = Bar().<!UNRESOLVED_REFERENCE!>body<!>()
|
||||
fun Foo.foo(body: Foo.() -> Unit) = body()
|
||||
fun Foo.xbar(body: XBar.() -> Unit) = Bar().body()
|
||||
fun Foo.xxbar(body: XXBar.() -> Unit) = Bar().body()
|
||||
|
||||
fun test() {
|
||||
Foo().foo {
|
||||
<!UNRESOLVED_REFERENCE!>xbar<!> {
|
||||
<!UNRESOLVED_REFERENCE!>foo<!> {}
|
||||
xbar {
|
||||
foo {}
|
||||
}
|
||||
<!UNRESOLVED_REFERENCE!>xxbar<!> {
|
||||
<!UNRESOLVED_REFERENCE!>foo<!> {}
|
||||
xxbar {
|
||||
foo {}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+4
-4
@@ -12,13 +12,13 @@ class Bar
|
||||
typealias YBar = ZBar
|
||||
typealias ZBar = <!OTHER_ERROR!>YBar<!>
|
||||
|
||||
fun Foo.foo(body: Foo.() -> Unit) = <!INAPPLICABLE_CANDIDATE!>body<!>()
|
||||
fun Foo.zbar(body: ZBar.() -> Unit) = Bar().<!UNRESOLVED_REFERENCE!>body<!>()
|
||||
fun Foo.foo(body: Foo.() -> Unit) = body()
|
||||
fun Foo.zbar(body: ZBar.() -> Unit) = Bar().body()
|
||||
|
||||
fun test() {
|
||||
Foo().foo {
|
||||
<!UNRESOLVED_REFERENCE!>zbar<!> {
|
||||
<!UNRESOLVED_REFERENCE!>foo<!> {}
|
||||
zbar {
|
||||
foo {}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user