Java 8: support auto-SMI of our Callable types
See original GitHub issue[@FroMage] In theory we should be able to pretend that any method in Java which accepts an SMI (Single-Method Interface) accepts a union of the SMI and its corresponding Ceylon Callable
, and do the magic auto-conversion in our backend, when provided with a Callable
.
Similarly we should be able to pretend that any method in Java which returns an SMI returns an intersection of the SMI and its corresponding Ceylon Callable
, and do the magic auto-conversion in our backend.
I’m not 100% convinced we can do this due to the usual issues with types and bounds and type-arguments, but we can try and investigate.
I highly doubt we’ll have time to do this for 1.1, so marking 1.2
[Migrated from ceylon/ceylon-compiler#1617]
Issue Analytics
- State:
- Created 9 years ago
- Comments:115 (106 by maintainers)
Top Results From Across the Web
Callable (Java Platform SE 8 ) - Oracle Help Center
The Callable interface is similar to Runnable , in that both are designed for classes whose instances are potentially executed by another thread....
Read more >Java 8 Runnable and Callable Lambda Example with Argument
Java 8 supports lambda expression. In java 8 Runnable interface has been annotated with @FunctionalInterface . Now we can create Runnable ...
Read more >Is there an interface similar to Callable but with arguments?
Since Java 8 there is a whole set of Function-like interfaces in the java.util.function package. The one you're asking for specifically is simply...
Read more >What is the difference between Callable<T> and Java 8's ...
I noticed that the lambda expression () -> Display.isCloseRequested() is actually type compatible with both Callable<Boolean> and Supplier<Boolean> .
Read more >Functional Interfaces in Java 8 | Baeldung
Since a primitive type can't be a generic type argument, there are versions of the Function interface for the most used primitive types...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This appears to work. Let’s see if I can make the IDEs compile with the changes I did.
I removed it after 😉