Simple Generic Function in Kotlin Fails
问题 Here's a simple generic function in Kotlin: fun <T> twice(x: T) : T { return 2 * x } Attempting to build this (either in a project or REPL) results in the following errors: error: none of the following functions can be called with the arguments supplied: public final operator fun times(other: Byte): Int defined in kotlin.Int public final operator fun times(other: Double): Double defined in kotlin.Int public final operator fun times(other: Float): Float defined in kotlin.Int public final