Closed raould closed 11 years ago
Why not add it as a parameter to the constructor function then?
please read https://github.com/back2dos/tinkerbell/issues/20 for that :-) the problem being that tink forces things in a particular place in the order of constructor arguments, and i don't like that, so these two issues together make things frustrating. on the whole i think this issue 34 is the one that would be the best solution to my frustration :-)
I am not 100% sure this what you're looking for, but I've now allowed to use _
as a marker in the constructor argument list, that will tell where the generated arguments go.
@:verbose class A implements tink.lang.Cls {
var c:Int = _;
var d:Int = _;
public function new(a:Int, _, b:Int) {} //Warning : public function new(a:Int, c, d, b:Int):Void { ...
}
Does that solve the problem?
sounds good, i'll try it out, thanks!
(like what i said in https://github.com/back2dos/tinkerbell/issues/20)
i wish i could specify something that was a required argument to new() but not something that became a full-blown instance field. i just want it to be available during the constructor function.