Java and TFunc<T,U> implementation

Hi

I tried to declare TFunc generic Delphi type both in .NET and Java :

  TFunc<T,R> = public delegate (arg : T) : R ; 
  TFunc<T,U,R> = public delegate (arg : T; cnt : U) : R ;

For .NET it works fine, I can use both types. But for Java I get error :

(E31) Multiple declarations of type "TFunc" exist but the partial modifier is missing

Is the error correct and what’s the solution for Java here ?

This is one of those edge cases of Java. Java doesn’t allow overloading generics like this, to do this cross pltaform, you’d have to rename 1 of them.

I did so, thanks.