[FIR] Properly set isReceiver for implicit invoke on function types

This commit is contained in:
Nikolay Lunyak
2023-11-28 12:01:34 +02:00
committed by Space Team
parent 2bd77d5cdc
commit c69c34ff8b
11 changed files with 21 additions and 45 deletions
@@ -1,30 +0,0 @@
// KT-5362 Compiler crashes on access to extension method from nested class
class Outer {
class Nested{
fun foo(s: String) = s.<!UNRESOLVED_REFERENCE!>extension<!>()
}
private fun String.extension(): String = this
}
// EA-64302 - UOE: CodegenContext.getOuterExpression
fun Activity.toast() = Unit
class Activity(){
class Fragment{
fun call() = <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>toast<!>()
}
}
// KT-8814 No error in IDE for invalid invoke of OuterClass.()->Unit in static nested class
public class Manager {
fun task(callback: Manager.() -> Unit): Task {
val task = Task(callback)
return task
}
class Task(val callback: Manager.() -> Unit) : Runnable {
override public fun run() {
<!ARGUMENT_TYPE_MISMATCH!>callback<!>() // Manager is not accessible here, but no error is shown
}
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// KT-5362 Compiler crashes on access to extension method from nested class
class Outer {
class Nested{