I want to do something like this:
fun process(minutes: Int) = 0
fun test() {
process(System.currentTimeMillis() / 1000 / 60) // error: Int expected
}
如果我try process((System.currentTimeMillis() / 1000 / 60) as Int)
,我在运行时会得到ClassCastException
.
So how can I convert Long to Int?