Why do generic functions can't have default arguments?

It can be written as

inline fun <reified T : Exception> expectException(kClass: KClass<T> = T::class, assert: () -> Unit)

But inline function is not my expectation in some cases. Can we support “reified” feature just for the default arguments? I mean that I don’t need to declare “inline” and “reified” in this case. Because I think when compiling source codes, compiler understands what “T” is .

1 Like