LastExceed
03/07/2020, 10:49 PMreified have to be declared explicitly ? are there cases where you'd want the type parameter of an inline function to NOT be reified ?Kroppeb
03/07/2020, 11:19 PMclass Foo<T>(val obj:T) {
fun bar() = test(obj) //error
}
inline fun <reified T> test(i: T) = i
calling test(obj) does not work when T in test is reified, as Foo doesn't actually know what T is. However if T is no longer reified then bar can call test(obj) without any issues.Hullaballoonatic
03/08/2020, 5:16 PMHullaballoonatic
03/08/2020, 5:17 PMreified (probably)
either way making the reified implicit likely would break backwards compatibility so likely never gonna happenKroppeb
03/08/2020, 7:07 PMcan't the compiler just tell us that, then?What do you mean?