如何设置@optics注解的箭头依赖项才能实际工作?不会为使用@optics注释的数据类生成伴生对象。
如果我没记错的话,这是一个批注处理器,所以应该使用kapt导入它,但是the documentation将它用作compile。
发布于 2019-10-07 18:39:43
对于箭头0.10.0
apply plugin: 'kotlin-kapt'
def arrow_version = "0.10.1-SNAPSHOT"
dependencies {
implementation "io.arrow-kt:arrow-optics:$arrow_version"
implementation "io.arrow-kt:arrow-syntax:$arrow_version"
kapt "io.arrow-kt:arrow-meta:$arrow_version" // <-- this is the kapt plugin
}然后:
@optics data class Street(val number: Int, val name: String) {
companion object {} // <-- this is required
}发布于 2019-10-13 18:00:58
所有内容都在文档中解释过了,我不知道我是怎么漏掉的
https://stackoverflow.com/questions/58243913
复制相似问题