someone know in what cases K/N failed with `Receiv...
# kotlin-native
a
someone know in what cases K/N failed with
Receiver of 'initBy' must be a 'this' of the constructed class
? class is simple:
Copy code
@ExportObjCClass
class MyTableViewCell : UITableViewCell {

    @OverrideInit
    constructor(
        style: UITableViewCellStyle,
        reuseIdentifier: String?
    ) : super(style = style, reuseIdentifier = reuseIdentifier)

    @OverrideInit
    constructor(coder: NSCoder) : super(coder = coder)
}
s
According to the docs overridden constructors by default can only call the designated initializer. https://github.com/JetBrains/kotlin-native/blob/master/OBJC_INTEROP.md#subclassing-swiftobjective-c-classes-and-protocols-from-kotlin
a
both initializer is designated. for designated error different 🙂
@olonho maybe you can help?
🆗 1
s
May be a compiler bug, but this code isn’t enough to reproduce it: the compiler properly handles the code; I checked both 1.3.50 and 1.3.60 EAP. Could you share a reproducer?
a
not reproduces? Oo i will try on empty project today
s
Nevermind, I’ve successfully reproduced it.
👌 1
Apparently it is already fixed in 1.3.60.
😞 1
a
maybe suggest workaround for 1.3.50?
s
Moving the class from a library to program/framework may help.
a
yes, it works. will wait 1.3.60 🙂
👍 1