小编Abb*_*bba的帖子

使用Kotlin创建自定义Dagger 2范围

我正在尝试将Java代码转换为Kotlin以创建自定义匕首.

这是Java代码:

@Documented
@Scope
@Retention(RetentionPolicy.RUNTIME)
public @interface CustomScope {
}
Run Code Online (Sandbox Code Playgroud)

一旦转换成kotlin,结果就是这里

@Scope
@Documented
@Retention(RetentionPolicy.RUNTIME) annotation class CustomScope 
Run Code Online (Sandbox Code Playgroud)

我有一个类型不匹配@Retention(RetentionPolicy.RUNTIME).我有以下错误消息:必需类型是AnnotationRetention但找到了RetentionPolicy类型.

@interface似乎也被取代了.

java android kotlin dagger-2

9
推荐指数
1
解决办法
2428
查看次数

标签 统计

android ×1

dagger-2 ×1

java ×1

kotlin ×1