IDE向我展示@Suppress在解构声明之前无法放置的提示
@Suppress("UNCHECKED_CAST")
var test = authentication.details as Pair<String?,String?>
@Suppress("UNCHECKED_CAST")
val (token,role) = authentication.details as Pair<String?,String?>
答案 0 :(得分:0)
您可以像这样注释表达式:
val (token,role) = @Suppress("UNCHECKED_CAST") (authentication.details as Pair<String?,String?>)