-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
FunctionalInterface annotation for JVM1.8+ on Kotlin functions #5396
base: master
Are you sure you want to change the base?
Conversation
All Java built-in function types like `BiFunction`, `IntProvider` have this annotation. Also, this annotation is used by the GraalVM Polyglot library. It can only parse types with this annotation to a JavaScript function, that's why I want to add this.
By the way, I think |
Can you please clarify where it is documented that this is the case? Or maybe there is a sample project where something breaks once you remove the |
CCBlueX/LiquidBounce#5454 At first, I implement them as methods in object: Then I found that the Polyglot throws an exception on script execution: After that I tried another functions like a simple After replace with a custom |
I'm wondering how this would affect android API 23 and below as these APIs are not available. Have you tested it? |
Well, I'm not a Android developer, this is only tested on desktop JDK 8, 17 and 21. |
Android API 23 seems to not support this annotation (because this is included in stdlib from Java 8) |
So we might only use this if the class is existing. But as far as I know, latest Kotlin 2.x only supports Java 1.8 and higher versions. |
All Java built-in function types like
BiFunction
,IntProvider
have this annotation. Also, this annotation is used by the GraalVM Polyglot library. It can only parse types with this annotation to a JavaScript function, that's why I want to add this.