Fix issue getting the size property from Collection bounded type
parameters, when lowering for-loops over Collection.indices.
This commit is contained in:
committed by
max-kammerer
parent
30679ebfaf
commit
21178a4f1a
+4
-1
@@ -518,8 +518,11 @@ internal class CollectionIndicesHandler(context: CommonBackendContext) : Indices
|
||||
parameterCount { it == 0 }
|
||||
}
|
||||
|
||||
// The lowering operates on subtypes of Collection. Therefore, the IrType could be
|
||||
// a type parameter bounded by Collection. When that is the case, we cannot get
|
||||
// the class from the type and instead uses the Collection getter.
|
||||
override val IrType.sizePropertyGetter
|
||||
get() = getClass()!!.getPropertyGetter("size")!!.owner
|
||||
get() = getClass()?.getPropertyGetter("size")?.owner ?: context.ir.symbols.collection.getPropertyGetter("size")!!.owner
|
||||
}
|
||||
|
||||
internal class CharSequenceIndicesHandler(context: CommonBackendContext) : IndicesHandler(context) {
|
||||
|
||||
Reference in New Issue
Block a user