-
Notifications
You must be signed in to change notification settings - Fork 157
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
Reflect.compareMethods doesn't work as expected #578
Comments
The problem is actually quite complex to solve. It can be reproduced using this minimal sample: class Main {
static var LAST = null;
static function foo<T>( x : T -> Void ) { LAST = x; return x; }
static function test<T>( x : T -> Void ) return Reflect.compareMethods(x,LAST);
static function main() {
var h = foo(function(x : String) {});
Sys.println(test(h)); // false should be true !
}
} What happens is that passing
And when calling "test", we wrap again the wrapped closure because we can't tell at compilation it's been already wrapped:
So the two methods ends up being closures over a different subfunction. Solving this would require to be able to identify a wrapper generated closure from an user one and unwrap it in |
Found similar problem with flixel dispatcher. As a temporary workaround for my case I just used |
…-time listeners for HL target ( see HaxeFoundation/hashlink#578 )
* Remove handler directly since we already work with it. This fixes one-time listeners for HL target ( see HaxeFoundation/hashlink#578 ) * upd unit tests
using https://github.com/haxe-utest/utest
$ haxe hxml/common.hxml -hl bin/test.hl
$ hl bin/test.hl
shows errors in file
https://github.com/haxe-utest/utest/blob/master/test/utest/TestDispatcher.hx#L9-L18
it uses class from src/utest/Dispatcher.hx where error happens in function remove():
https://github.com/haxe-utest/utest/blob/master/src/utest/Dispatcher.hx#L59-L66
The text was updated successfully, but these errors were encountered: