You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an extern inline overload function which takes a Haxe function as a parameter.
Create a second extern inline overload function of the same name, also taking a Haxe function as a parameter, but with a different signature.
Attempt to build on the Java target.
Expected result:
The expected result is that the appropriate overload is inlined for each use case.
Actual result:
The following compiler error is received:
Another overloaded field of similar signature was already declared : displayItems
... The signatures are different in Haxe, but not in the target language
... The second field is declared here
From what I understand, it is evaluating the two functions as both having the same argument (haxe.lang.Function I believe) when I was under the impression Haxe would inline the code before converting types like this.
Notes:
It is fully reasonable to expect that two overloads should not be able to take the same parameters. However:
At compile time, it is fully possible for the compiler to distinguish these two functions, as the only parameter (a generator function in my case) has a different number and type of parameters for each overload.
During compilation, these functions will be inlined to their appropriate bodies anyway.
After compilation, the resulting code has no ambiguous overloads.
I have not evaluated the effectiveness of this on the JVM target.
The text was updated successfully, but these errors were encountered:
From your description that indeed sounds like a missing check.
As a general note, it would really help if you included reproducible code examples in your issues. I understand that this can sometimes be difficult when native libraries and whatnot are involved, but in this case it should be quite straightforward.
Thanks! And yes, we should just not check this on externs. There's even a comment saying (* OVERLOADTODO: generalize this and respect whether or not we actually generate the functions *).
Steps to reproduce:
extern inline overload
function which takes a Haxe function as a parameter.extern inline overload
function of the same name, also taking a Haxe function as a parameter, but with a different signature.Expected result:
The expected result is that the appropriate overload is inlined for each use case.
Actual result:
The following compiler error is received:
From what I understand, it is evaluating the two functions as both having the same argument (
haxe.lang.Function
I believe) when I was under the impression Haxe would inline the code before converting types like this.Notes:
It is fully reasonable to expect that two overloads should not be able to take the same parameters. However:
I have not evaluated the effectiveness of this on the JVM target.
The text was updated successfully, but these errors were encountered: