This repository was archived by the owner on Aug 10, 2021. It is now read-only.

Description
From Swift, I try to access the companion object like this:
let p = Ping.Companion()
let d = p.NO_DISTANCE
The compiler error (Swift 4.2):
'NO_DISTANCE' has been renamed to 'no_DISTANCE'
'NO_DISTANCE' was obsoleted in Swift 3
Sure enough, I am able to access it like this:
let d = p.no_DISTANCE
Here is the Kotlin code:
data class Ping(
val id: String,
val distance: Double,
val rssi: Int
) {
companion object {
const val NO_DISTANCE: Double = -1.0
const val NO_RSSI: Int = 10000
}
}
Here is the relevant section from the library header file:
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Ping.Companion")))
@interface MyLibPingCompanion : KotlinBase
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
+ (instancetype)companion __attribute__((swift_name("init()")));
@property (readonly) double NO_DISTANCE;
@property (readonly) int32_t NO_RSSI;
@end;