Filter out expect declarations

This commit is contained in:
Pavel Punegov
2018-05-28 20:37:36 +03:00
committed by Pavel Punegov
parent 374397d03f
commit eed9f31dac
2 changed files with 4 additions and 2 deletions
@@ -38,6 +38,7 @@ import org.jetbrains.kotlin.ir.util.constructors
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedSimpleFunctionDescriptor
import org.jetbrains.kotlin.types.KotlinType
import kotlin.properties.Delegates
@@ -228,7 +229,7 @@ internal class KonanSymbols(context: Context, val symbolTable: SymbolTable): Sym
.singleOrNull {
it.valueParameters.isEmpty()
&& (it.extensionReceiverParameter?.type?.constructor?.declarationDescriptor as? ClassDescriptor)?.defaultType == type
&& it.isActual
&& !it.isExpect
}
?: throw Error(type.toString())
return symbolTable.referenceSimpleFunction(descriptor)
@@ -40,6 +40,7 @@ import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.ir.expressions.impl.IrGetFieldImpl
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedPropertyDescriptor
import org.jetbrains.kotlin.types.TypeUtils
internal class LateinitLowering(
@@ -53,7 +54,7 @@ internal class LateinitLowering(
.getContributedVariables(Name.identifier("isInitialized"), NoLookupLocation.FROM_BACKEND).single {
it.extensionReceiverParameter.let {
it != null && TypeUtils.getClassDescriptor(it.type) == context.reflectionTypes.kProperty0
} && it.isActual
} && !it.isExpect
}
private val isInitializedGetterDescriptor = isInitializedPropertyDescriptor.getter!!