Hi, how do I instantiate a class passed through as...
# announcements
r
Hi, how do I instantiate a class passed through as a function argument? The following don't work.
Copy code
fun myFunc(aClass: KClass<out View>) {
    return aClass()
}
myFunc(TextView::class)
I get
invoke()
not found error, and if I get android studio to auto create extension it. I get other errors.