I'm trying to confirm `KotlinEnum` to `Identifiab...
# kotlin-native
p
I'm trying to confirm
KotlinEnum
to
Identifiable
with the following code:
Copy code
extension KotlinEnum: Identifiable {
    public var id: Int32 { ordinal }
}
but the build fails with the following:
Copy code
Extension of a generic Objective-C class cannot access the class's generic parameters at runtime
I don't understand the problem, as
ordinal
has strict type
Int32
, not a generic one. How can I bypass it?
r
The problem is with
KotlinEnum
, not
id
and
ordinal
. It has a generic parameter
E
and Obj-C to Swift bridging requires that you specify a fixed type for that generic when defining an extension
👍 1