https://kotlinlang.org logo
#compiler
Title
# compiler
e

eygraber

01/05/2023, 2:06 AM
For the following function, I need to invoke
bar
with both types specified. Why can't
Parent
be inferred from the receiver?
Copy code
inline fun <Parent, reified Child : Parent> Foo<Parent>.bar()
y

Youssef Shoaib [MOD]

01/08/2023, 12:15 PM
You can (I think) do:
myFoo.bar<_, ChildType>()
_ is a placeholder which tells the compiler to try to infer the type argument
4 Views