Mark
03/11/2023, 5:20 AMinline fun <reified T: Enum<T>> Foo.enumBar(name: String): Bar<T?> = this.propertyToHide.toBar(name)
jw
03/11/2023, 5:22 AMMark
03/11/2023, 6:33 AMKClass
(using T::class
) and then use that to get the enum
instance. So I wouldn’t be able to use enumValueOf()
but maybe this instead:
fun <T: Enum<T>> enumValues(enumClass: KClass<out T>): Array<out T> = enumClass.java.enumConstants
jw
03/11/2023, 11:16 AMMark
03/11/2023, 1:25 PMString
I want to convert in the inline function), so instead (of passing KClass<T>
) I now pass toEnumOrNull: String.() -> T?
which is obtained (String::toEnumOrNull
) in the inline function. This all works well to allow hiding of that property, but on the other hand these new overloaded funs (with the lambda arg) are now exposed. I guess there is no way around this?elizarov
03/13/2023, 12:17 PMinternal
members that are marked with @PublishedApi
.