Philip Dukhov
10/22/2021, 2:27 PMKotlinEnum
to Identifiable
with the following code:
extension KotlinEnum: Identifiable {
public var id: Int32 { ordinal }
}
but the build fails with the following:
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?russhwolf
10/22/2021, 2:48 PMKotlinEnum
, 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