-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try overload resolution ambiquity #17
Comments
Hi @EliasJorgensen , I never used Kotlin before and just tried it. It's cool 😎 . I can reproduce the problem (#18). I think this issue should go to vavr core (https://github.com/vavr-io/vavr) because vavr-kotlin is only a wrapper. It seems that Kotlin cannot distinguish function and supplier when the methods are overloaded. For Java Optional, it works because it has only two overloaded methods: TL;DR: I think there is no easy and short term solution here |
Hi @mincong-h, thanks for checking out my bug report. I'm a bit unsure whether you want me to report the bug in the core repository, as there is no easy "fix"? Let me know and i'll create one 😄 |
@EliasJorgensen , sorry I was not clear. I think there is nothing to do on your side. Let's wait and see if Daniel, Ruslan, or other members have some thoughts about this. |
When i use

Try.getOrElseThrow
, i get the following error:This is the code in question:
This is my exception:
I am using it the same way that i would throw an exception with
java.util.Optional.getOrElseThrow
, so i believe this to be a bug.I can make it work by putting the exception in a lambda, but i believe this to be a bad solution, especially given that IntelliJ keeps suggesting me to remove the useless lambda.
The text was updated successfully, but these errors were encountered: