4
我定義實現枚舉類的Neo4j的RelationshipType
:在Kotlin中,當枚舉類實現接口時,如何解決繼承的聲明衝突?
enum class MyRelationshipType : RelationshipType {
// ...
}
我收到以下錯誤:
Inherited platform declarations clash: The following declarations have the same JVM signature (name()Ljava/lang/String;): fun <get-name>(): String fun name(): String
據我所知,無論是從Enum
類name()
方法,並從name()
方法RelationshipType
接口具有相同的簽名。然而,這在Java中並不是問題,那麼爲什麼它在Kotlin中是錯誤的,我該如何解決它?