Karlo Lozovina
02/25/2022, 7:33 PMnoneOf(T::class.java)
, noneOf(T::class)
work. If I pass around a value, then everything works fine (noneOf(value::class.java)
), but is there a way to keep everything on the type level?Rob Elliot
02/25/2022, 11:09 PMinline fun <reified T : Enum<T>> noneOf(): EnumSet<T> = EnumSet.noneOf(T::class.java)
Rob Elliot
02/25/2022, 11:10 PMval x = noneOf<MyEnum>()
Karlo Lozovina
02/26/2022, 12:59 AMKarlo Lozovina
02/26/2022, 12:59 AMPaul Griffith
02/26/2022, 2:11 AMinline reified
- if you give it the same name as the class you can use it transparently
https://pl.kotl.in/MF7-JYB83Rob Elliot
02/26/2022, 9:29 AMoperator fun invoke
on a companion object:
https://pl.kotl.in/0pmoOuZ8CKarlo Lozovina
02/26/2022, 6:41 PMinvoke
operator 😄. Maybe a bit too clever, but it's a small codebase, why not go wild a bit! 😄