that is safe, whereas this isn't: ``` inline fun &...
# getting-started
a
that is safe, whereas this isn't:
Copy code
inline fun <reified T: Any, R: Any> ApplicationContext.getOtherBean(clz: Class<T>): R = this.getBean(typeRef<T>())
notice that the
clz
parameter isn't used, it just allows T to come in reified. But it breaks if people call it with
getOtherBean(MyClass::class.java)
vs.
getOtherBean<MyClass<WithGenerics>>(clz))
because they would result in two different Types