Propagate KotlinType into codegen methods where it's possible

This commit is contained in:
Mikhail Zarechenskiy
2018-07-17 16:30:08 +03:00
parent ec9d8e580e
commit 045e3f53b0
30 changed files with 129 additions and 93 deletions
@@ -92,7 +92,7 @@ abstract class AbstractAndroidExtensionsExpressionCodegenExtension : ExpressionC
return StackValue.functionCall(Type.VOID_TYPE, null) {
val bytecodeClassName = c.typeMapper.mapType(container).internalName
actualReceiver.put(c.typeMapper.mapType(container), it)
actualReceiver.put(c.typeMapper.mapType(container), container.defaultType, it)
it.invokevirtual(bytecodeClassName, CLEAR_CACHE_METHOD_NAME, "()V", false)
}
}
@@ -45,8 +45,9 @@ class ResourcePropertyStackValue(
val syntheticProperty = resource as AndroidSyntheticProperty
if ((containerOptions.cache ?: globalCacheImpl).hasCache && shouldCacheResource(resource)) {
val declarationDescriptorType = typeMapper.mapType(container)
receiver.put(declarationDescriptorType, v)
val declarationDescriptorKotlinType = container.defaultType
val declarationDescriptorType = typeMapper.mapType(declarationDescriptorKotlinType)
receiver.put(declarationDescriptorType, declarationDescriptorKotlinType, v)
val resourceId = syntheticProperty.resource.id
val packageName = resourceId.packageName ?: androidPackage