The inline
functions declared without reified
type parameters can be called from Java as regular Java functions. But the ones declared with the reified
type parameters are not callable from Java.
Even if you call it using the reflection like following:
Method method = MyClass.class.getDeclaredMethod("foo", Object.class);
method.invoke(new MyClass(), Object.class);
You get the UnsupportedOperationException: This function has a reified type parameter and thus can only be inlined at compilation time, not called directly.
If you have access to the code of the function, removing the reified
modifier in some cases works. In other cases, you need to make adjustment to the code to overcome the type erasure.