In Kotlin, how can I work around the inherited declarations clash when an enum class implements an interface?

后端 未结 2 1080
不思量自难忘°
不思量自难忘° 2021-01-04 11:53

I define an enum class that implements Neo4j\'s RelationshipType:

enum class MyRelationshipType : RelationshipType {
    // ...
}
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-04 12:05

    The example above is working with an interface having a property name instead of a function name().

    interface Name {
        val name: String;
    }
    
    enum class Color : Name {
        Blue
    }
    

提交回复
热议问题