FIR2IR: don't declare dispatch receiver for local functions
This commit is contained in:
committed by
Mikhail Glukhikh
parent
5a3367e09c
commit
da6e96f4f1
+3
-1
@@ -306,7 +306,9 @@ class Fir2IrDeclarationStorage(
|
||||
)
|
||||
}
|
||||
}
|
||||
if (function !is FirAnonymousFunction && containingClass != null && !isStatic) {
|
||||
// See [LocalDeclarationsLowering]: "local function must not have dispatch receiver."
|
||||
val isLocal = function is FirSimpleFunction && function.isLocal
|
||||
if (function !is FirAnonymousFunction && containingClass != null && !isStatic && !isLocal) {
|
||||
dispatchReceiverParameter = declareThisReceiverParameter(
|
||||
symbolTable,
|
||||
thisType = containingClass.thisReceiver?.type ?: error("No this receiver"),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
//adopted snippet from kdoc
|
||||
open class KModel {
|
||||
val sourcesInfo: String
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
class A {
|
||||
val result: String
|
||||
init {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
lateinit var result1: String
|
||||
lateinit var result2: String
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
enum class X {
|
||||
B {
|
||||
val value2 = "K"
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
class Test {
|
||||
|
||||
val property:Int
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +NestedClassesInAnnotations
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
|
||||
object O {
|
||||
|
||||
Reference in New Issue
Block a user