Java doesn't seem to support Func<T1, T2, ... TResult> style usage
Opened this issue · 1 comments
JoshuaKGoldberg commented
- Callable (TResult, no T1, ...): http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Callable.html
- Function (TResult, T1, no T2, ...): https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html
It looks like there's no way to support arbitrary numbers of parameters. C#'s built-in Func supports up to 16, but that's because it's a hardcoded interface 16 times.
JoshuaKGoldberg commented
For now, it's necessary to force GLS users to declare delegates (C#) / interfaces (Java,TypeScript) in order to pass lambdas around. This is moderately acceptable since it forces more accurate type checking on functions passed around... but it would be nice to have the option to not.