Seems relevant: <https://kotlinlang.slack.com/arch...
# eap
a
I have created a ticket: KT-91112 Type inference: reified Enum inferred as Nothing for a function-reference extension call since Kotlin 2.5 Thank you!
thank you color 1
Two workarounds can be used: 1. Specify the return type explicitly:
Copy code
fun fromString(string: String): Animal =
    Animal::string.find(string)
        ?: throw IllegalArgumentException("Bad animal: '$string'")
2. Specify the type arguments for `find`:
Copy code
fun fromString(string: String) =
    Animal::string.find<Animal, String>(string)
        ?: throw IllegalArgumentException("Bad animal: '$string'")
c
Thanks, I linked this thread to the original author
🙏 2