Does someone know how I can bring nullable in the ...
# announcements
r
Does someone know how I can bring nullable in the following parameter in terms of a type parameter
Copy code
class A<T>(val a: B<T>.()->Unit)
I tried:
Copy code
class A<T1, T2: (B<T>.()->Unit)? >(val a: T2)
But that failes stating that an extension function type cannot be used as upper bound. I want to be able to have the parameter nullable in some places and not nullable in others without creating two classes for it
d
Just using
T2 : ((B<T>) -> Unit)?
should work fine.
r
what version of kotlin are you using?
d
1.2.10, why?
r
ah... I did not spot the difference at first.
I'll see if that works for me, thanks
works like a charm, nice
🎉 1