https://kotlinlang.org logo
#functional
Title
# functional
p

pakoito

02/21/2019, 6:36 AM
you cannot have a lambda that’s generic for all <T>
b

breandan

02/21/2019, 6:41 AM
Is this a hard and fast rule? What allows the last example compile?
fun <T> foo(baz: T) = fun (bar: T): T = bar
p

pakoito

02/21/2019, 6:45 AM
that’ll return a lambda that works for one type
b

breandan

02/21/2019, 6:49 AM
Yes, I see now
3 Views