Questions tagged «kotlin-experimental»

1
将Kotlin内联类作为实体字段的会议室数据库
我试图让Room(https://developer.android.com/topic/libraries/architecture/room)与Kotlin的内联类一起工作,如Jake Whartons文章内联类使数据库ID大: @Entity data class MyEntity( @PrimaryKey val id: ID, val title: String ) inline class ID(val value: String) 编译此房间时抱怨 实体和Pojos必须具有可用的公共构造函数。您可以有一个空的构造函数或一个其参数与字段匹配的构造函数(按名称和类型)。 查看生成的Java代码,我发现: private MyEntity(String id, String title) { this.id = id; this.title = title; } // $FF: synthetic method public MyEntity(String id, String title, DefaultConstructorMarker $constructor_marker) { this(id, title); } …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.