```inline fun <reified T> calc(p: String): T...
# announcements
d
Copy code
inline fun <reified T> calc(p: String): T? {
  return if (null is T) {
    println("nullable")
    null
  } else {
    println("not nullable")
    "foo" as T?
  }
}

fun main() {
  calc<String?>("hello")
  calc<String>("hello")
}
k
No, in general Kotlin doesn't want to infer anything about the type parameter. There's an issue about it but I can't seem to find it.
r
in this case all result will be nullable even if response can be no nullable
@karelpeeters will be great if will find it, thanks