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(
|
dispatchReceiverParameter = declareThisReceiverParameter(
|
||||||
symbolTable,
|
symbolTable,
|
||||||
thisType = containingClass.thisReceiver?.type ?: error("No this receiver"),
|
thisType = containingClass.thisReceiver?.type ?: error("No this receiver"),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
//adopted snippet from kdoc
|
//adopted snippet from kdoc
|
||||||
open class KModel {
|
open class KModel {
|
||||||
val sourcesInfo: String
|
val sourcesInfo: String
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
class A {
|
class A {
|
||||||
val result: String
|
val result: String
|
||||||
init {
|
init {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
|
|
||||||
lateinit var result1: String
|
lateinit var result1: String
|
||||||
lateinit var result2: String
|
lateinit var result2: String
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
enum class X {
|
enum class X {
|
||||||
B {
|
B {
|
||||||
val value2 = "K"
|
val value2 = "K"
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
class Test {
|
class Test {
|
||||||
|
|
||||||
val property:Int
|
val property:Int
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// !LANGUAGE: +NestedClassesInAnnotations
|
// !LANGUAGE: +NestedClassesInAnnotations
|
||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
import kotlin.test.*
|
import kotlin.test.*
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// KJS_WITH_FULL_RUNTIME
|
// KJS_WITH_FULL_RUNTIME
|
||||||
|
|
||||||
object O {
|
object O {
|
||||||
|
|||||||
Reference in New Issue
Block a user