0xFF0000FF整数文字不符合预期的类型kotlin.Int [英] 0xFF0000FF An integer literal does not conform to the expected type kotlin.Int

查看:87
本文介绍了0xFF0000FF整数文字不符合预期的类型kotlin.Int的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么这个方法行不通:

Why doesn't this work:

var color: Int = 0xFF0000FF

以及为什么我必须致电toInt()

and why do I have to call toInt()

var color: Int = 0xFF0000FF.toInt()

推荐答案

这是编译器中的错误,请随时投票/观看:

This is a bug in the compiler, feel free to vote / watch it: https://youtrack.jetbrains.com/issue/KT-2780

这篇关于0xFF0000FF整数文字不符合预期的类型kotlin.Int的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆