Bradleycorn
04/23/2024, 7:33 PMdata class Race(val description: String)
I updated my project from Kotlin 1.9.10 to 1.9.21 and now I’m getting this warning:
var MyPackage.Race.description' was renamed to 'var MyPackage.Race.description_' because of a name collision with an another declaration 'func MyPackage.KotlinBase.description() -> Swift.String'. Consider resolving the conflict either by changing the name in Kotlin, or via the @ObjCName annotation. You can also suppress this warning using the 'SuppressSkieWarning.NameCollision' configuration. However using renamed declarations from Swift is not recommended because their name will change if the conflict is resolved.
(at val description: String defined in com.my.package.core.models.program.Race)
I’m not sure where this came from, nor the best way to resolve it?Darron Schall
04/23/2024, 8:22 PMRace
(indirectly) extends NSObject
, but NSObject
already comes with a description
property per https://developer.apple.com/documentation/objectivec/nsobject/1418799-description?language=objc
The workaround is to choose a different property name in the Race
class, either by changing the property name directly or by annotating it with @ObjCName
to change the name exported by K/N to avoid the collision.Bradleycorn
04/23/2024, 8:25 PMBradleycorn
04/23/2024, 8:28 PMYou can also suppress this warning using the ‘SuppressSkieWarning.NameCollision’ configuration.Notably the
SupressSkieWarning
… Looks like this is a warning that the Touchlab Skie library has added recently, which explains why I just now started seeing it.
While I can rename my own object property, I also get the warning for a property in a KTOR enum, which I obviously can’t rename, so that’s unfortunate.