Remove descriptor usage from Scope.kt
This commit is contained in:
+4
-4
@@ -331,7 +331,7 @@ open class SerializerIrGenerator(
|
||||
}
|
||||
|
||||
// returns null: Any? for boxed types and 0: <number type> for primitives
|
||||
private fun IrBuilderWithScope.defaultValueAndType(prop: SerializableProperty): Pair<IrExpression, KotlinType> {
|
||||
private fun IrBuilderWithScope.defaultValueAndType(prop: SerializableProperty): Pair<IrExpression, IrType> {
|
||||
val kType = prop.descriptor.returnType!!
|
||||
val T = kType.toIrType()
|
||||
val defaultPrimitive: IrExpression? = when {
|
||||
@@ -346,9 +346,9 @@ open class SerializerIrGenerator(
|
||||
else -> null
|
||||
}
|
||||
return if (defaultPrimitive == null)
|
||||
irNull(compilerContext.irBuiltIns.anyNType) to (compilerContext.builtIns.nullableAnyType)
|
||||
irNull(compilerContext.irBuiltIns.anyNType) to (compilerContext.irBuiltIns.anyNType)
|
||||
else
|
||||
defaultPrimitive to kType
|
||||
defaultPrimitive to T
|
||||
}
|
||||
|
||||
override fun generateLoad(function: FunctionDescriptor) = irClass.contributeFunction(function) { loadFunc ->
|
||||
@@ -382,7 +382,7 @@ open class SerializerIrGenerator(
|
||||
irTemporaryVar(
|
||||
expr,
|
||||
"local$i",
|
||||
typeHint = type
|
||||
type
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user