We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
outputs
1, null 2, null
class Test { public var func:(Dynamic, Dynamic) -> Void; public function new(obj:Dynamic) { this.func = obj.test; } public function call(k:Dynamic, v:Dynamic) { func(k, v); } } class Main { public static function main() { var a = new Test({ test: function(k:Dynamic, v:Dynamic) { trace(k, v); } }); a.func("a", 1); a.call("b", 2); } }
meanwhile this works
class Main { public static function main() { var a = { test: function(k:Dynamic, v:Dynamic) { trace(k, v); } }; a.test("a", 1); } }
so somewhere between it going into a class breaks it
I believe this is due to it generating the function as
function(self, k, v)
generated code for first example:
Test.new = function(obj) local self = _hx_new(Test.prototype) Test.super(self,obj) return self end Test.super = function(self,obj) self.func = obj.test; end Test.__name__ = true Test.prototype = _hx_e(); Test.prototype.func= nil; Test.prototype.call = function(self,k,v) self.func(k, v); end Test.prototype.__class__ = Test Main.new = {} Main.__name__ = true Main.main = function() local a = Test.new(_hx_o({__fields__={test=true},test=function(self,k,v) __haxe_Log.trace(k, _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true,customParams=true},fileName="src/Main.hx",lineNumber=25,className="Main",methodName="main",customParams=_hx_tab_array({[0]=v}, 1)})); end})); a.func("a", 1); a:call("b", 2); end
meanwhile second
Main.new = {} Main.__name__ = true Main.main = function() (function(k,v) __haxe_Log.trace(k, _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true,customParams=true},fileName="src/Main.hx",lineNumber=25,className="Main",methodName="main",customParams=_hx_tab_array({[0]=v}, 1)})); end)("a", 1); end
The text was updated successfully, but these errors were encountered:
Might be related: #10089
Sorry, something went wrong.
No branches or pull requests
outputs
meanwhile this works
so somewhere between it going into a class breaks it
I believe this is due to it generating the function as
function(self, k, v)
generated code for first example:
meanwhile second
The text was updated successfully, but these errors were encountered: