Transform variable-as-function calls for extension functions
In the following code example fun test(f: Any.() -> Unit) = 42.f() front-end resolves variable-as-function call for 'f' as 'invoke' with signature 'Function1<Any, Unit>#Any.() -> Unit'. However, Function1<Any, Unit> has a single 'invoke' method with signature 'Function1<Any, Unit>#(Any) -> Unit'. This didn't cause any problems with loosely typed JVM and JS back-ends. However, in IR with symbols this means a reference to non-existing declaration.
This commit is contained in:
@@ -12,6 +12,6 @@ FILE /extFunInvokeAsFun.kt
|
||||
VALUE_PARAMETER value-parameter block: kotlin.Any?.() -> kotlin.Unit
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='with2(Any?, Any?.() -> Unit): Unit'
|
||||
CALL 'invoke() on Any?: Unit' type=kotlin.Unit origin=INVOKE
|
||||
CALL 'invoke(Any?): Unit' type=kotlin.Unit origin=INVOKE
|
||||
$this: GET_VAR 'value-parameter block: Any?.() -> Unit' type=kotlin.Any?.() -> kotlin.Unit origin=VARIABLE_AS_FUNCTION
|
||||
$receiver: GET_VAR 'value-parameter receiver: Any?' type=kotlin.Any? origin=null
|
||||
p1: GET_VAR 'value-parameter receiver: Any?' type=kotlin.Any? origin=null
|
||||
|
||||
Reference in New Issue
Block a user