一个奇葩的bug,关于Backend Internal error: Exception during IR lowering

// viewmodel中定义两个数据
class LoginViewModel @Inject constructor() : BaseViewModel<LoginIntent>() {
    val height = MutableStateFlow(-1f)
    val weight = MutableStateFlow(-1f)
}

// UI中使用该数据做判定:
BaseLoginScreen(
	canNextClick = vm.weight.collectAsState().value!=-1f && vm.weight.collectAsState().value!=-1f,
) { 。。。 }
// 此时会报错,提示Backend Internal error: Exception during IR lowering,还有Runtime JAR files in the classpath should have the same version.

// 然而改成下面这种形式就对了:
val height = vm.weight.collectAsState().value
val weight = vm.weight.collectAsState().value
BaseLoginScreen(
	canNextClick = height!=-1f && weight!=-1f,
) { 。。。 }
上一篇:MyEclipse快捷键大全


下一篇:Windows10下Django虚拟环境配置和简单入门实例