【发布时间】:2018-06-10 22:27:27
【问题描述】:
我正在尝试将 Java 代码转换为 Kotlin 以创建自定义匕首范围。
这是Java代码:
@Documented
@Scope
@Retention(RetentionPolicy.RUNTIME)
public @interface CustomScope {
}
这里转换成kotlin就是结果
@Scope
@Documented
@Retention(RetentionPolicy.RUNTIME) annotation class CustomScope
我的类型与 @Retention(RetentionPolicy.RUNTIME) 不匹配。我收到以下错误消息:Required Type is AnnotationRetention but RetentionPolicy type was found.
@interface 似乎也被替换了。
【问题讨论】:
标签: java android kotlin dagger-2