handsome-television-62908
07/30/2020, 8:51 PMbright-gpu-74537
07/30/2020, 8:52 PMbright-gpu-74537
07/30/2020, 8:52 PMbright-gpu-74537
07/30/2020, 8:52 PMbright-gpu-74537
07/30/2020, 8:52 PMbright-gpu-74537
07/30/2020, 8:53 PMhaxe
class MyComponent extends Box {
public function new(someparam:String) {
super();
}
// macro generates something like:
public function clone():MyComponent {
var c = new MyComponent(); // <---- this errors
return c;
}
}
handsome-television-62908
07/30/2020, 8:53 PMhandsome-television-62908
07/30/2020, 8:54 PMbright-gpu-74537
07/30/2020, 8:55 PMbright-gpu-74537
07/30/2020, 8:55 PMhandsome-television-62908
07/30/2020, 8:55 PMhandsome-television-62908
07/30/2020, 8:55 PMhandsome-television-62908
07/30/2020, 8:56 PMbright-gpu-74537
07/30/2020, 8:56 PMbright-gpu-74537
07/30/2020, 8:56 PMhandsome-television-62908
07/30/2020, 8:57 PMhandsome-television-62908
07/30/2020, 8:57 PMbright-gpu-74537
07/30/2020, 8:58 PMbright-gpu-74537
07/30/2020, 8:58 PMhandsome-television-62908
07/30/2020, 9:04 PMhandsome-television-62908
07/30/2020, 9:06 PMbright-gpu-74537
07/30/2020, 9:07 PMnew $typePath();
in the macro, however, if you have non default constructor params then that aint gonna work (as it doesnt)... so its easy enough to do something like new $typePath(p1, p2, p3);
i can find out the name and type of those params from the constructor... what i dont know is what values p1,p2, etc should holdbright-gpu-74537
07/30/2020, 9:07 PMbright-gpu-74537
07/30/2020, 9:08 PMhaxe
class MyComponent extends Box {
var bob:String;
public function new(someparam:String) {
super();
this.bob = someparam;
}
}
bright-gpu-74537
07/30/2020, 9:09 PMthis.someparam
, and in fact, i cant even say that you just ignore that param altogetherbright-gpu-74537
07/30/2020, 9:10 PM____someparam
(for example), then i cant say that that param hasnt changed either when it comes to clonebright-gpu-74537
07/30/2020, 9:10 PMbright-gpu-74537
07/30/2020, 9:13 PMbright-gpu-74537
07/30/2020, 9:15 PMbright-gpu-74537
07/30/2020, 9:16 PM