san*_*ami 2 java enums android kotlin
我使用枚举作为参数,但出现此错误
错误:从第 5 版开始,'enum' 是一个关键字,不能用作标识符
Run Code Online (Sandbox Code Playgroud)private final kotlin.jvm.functions.Function1<com.tylertech.newworld.mobility.enum.CustomAlertDialogEvents, kotlin.Unit> itemClicked = null;
下面是我的枚举类
enum class CustomAlertDialogEvents(var resId: Int, val value: Int) {
ACTION_OPEN_SETTINGS(R.string.open, 0),
ACTION_CLOSE_SETTINGS(R.string.close, 1)
}
Run Code Online (Sandbox Code Playgroud)
我是这样使用的
private val itemClicked: (CustomAlertDialogEvents) -> Unit
Run Code Online (Sandbox Code Playgroud)
任何想法为什么会出现此错误?
| 归档时间: |
|
| 查看次数: |
1100 次 |
| 最近记录: |