I have the following code:
class Camera : AsyncActiveInputDevice<Image> { constructor(inputListener: ((Image) -> Unit)? = null) { this.inputListener = inputListener } override var inputListener: ((Image) -> Unit)? set(value) { field = value TODO("call C/Python implementation") } } And IntelliJ IDEA is suggesting converting the constructor to a primary constructor.
So how to convert this? How to init a property with a setter in a primary constructor? I have tried init blocks but it then shows an error: "Variable can not be initialized before declaration".