Is there any way the compiler could figure out the...
# android
a
Is there any way the compiler could figure out the type argument for Foo based on the constructor argument?
Copy code
abstract class Foo<T : ViewBinding>(inflateBinding: (LayoutInflater, ViewGroup?, Boolean) -> T)

class Bar() : Foo<SomeVeryLongLayoutNameBinding>(SomeVeryLongLayoutNameBinding::inflate)
So that I could write this instead:
Copy code
class Bar() : Foo(SomeVeryLongLayoutNameBinding::inflate)
Currently the best I could come up with is:
Copy code
class Bar() : Foo<SomeVeryLongLayoutNameBinding>(::inflate)
But it doesn't work when I have multiple classes like
Bar
in one file, so I'm wondering if I can do anything to make the compiler figure this out