Gleb Minaev
03/26/2026, 1:54 PMsuppliedTypesStorage with a delegate provided by a custom function fun suppliedTypesStorageDelegate(): ReadWriteProperty<Any?, Map<String, List<SuppliedType>>>. Then on backend, I set a value to the property in a class's constructor via
val suppliableClassSuppliedTypesStorageSetterIrSimpleFunctionSymbol = suppliableClassIrClassSymbol.getPropertySetter("suppliedTypesStorage")!!
...
val irClass = <an IrClass instance that describes the class which constructor I modify>
+irCall(suppliableClassSuppliedTypesStorageSetterIrSimpleFunctionSymbol).apply {
arguments[0] = irGet(irClass.thisReceiver!!)
arguments[1] = irCall(mapOfIrSimpleFunction).apply { ... }
}
The code compiles but throws class java.util.LinkedHashMap cannot be cast to class kotlin.properties.ReadWriteProperty during runtime. Looks like irCall(suppliableClassSuppliedTypesStorageSetterIrSimpleFunctionSymbol) is resolved not to the property setter but to the delegate's field setter. Do I miss something? Should I report it?Gleb Minaev
03/26/2026, 2:01 PMsuppliedTypesStorage$delegate instead of using it as a delegate. I guess it's my mistake during FIR modification. But I don't know what's wrong with the property generation. The property is described here: https://github.com/lounres/Kone/blob/665ad7e50fad9e15231738213be5d33333cee14b/plug[…]iedTypes/fir/SuppliedTypesStoragePropertyGenerationExtension.ktGleb Minaev
03/28/2026, 5:22 PMcreateMemberProperty treat backing field as a real backing field instead of delegate field. So I just replaced them with `null`s in FIR and generated them manually in IR.