I get the following warning in Intellij Idea (build: 173.3727.127, Kotlin plugin: latest): `Kotlin: Unreachable Code`

for the code (in line 4: `return when (a) {`

):

```
fun pow(a: Number, b: Int): Number {
if (b == 0) return 1
if (b == 1) return a
return when (a) {
is Long -> {
return if (b % 2 == 0) pow(a * a, b / 2)
else a * pow(a * a, b / 2) as Long
}
is Int -> {
return if (b % 2 == 0) pow(a * a, b / 2)
else a * pow(a * a, b / 2) as Int
}
is BigInteger -> {
return if (b % 2 == 0) pow(a * a, b / 2)
else a * pow(a * a, b / 2) as BigInteger
}
else -> throw IllegalArgumentException("only Long, Int, BigInteger are supported")
}
}
```

The code works fine for Long, Int, and BigInteger as expected.