https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • h

    handsome-television-62908

    07/30/2020, 8:38 PM
    I believe this is by design, and the way around it is to make arguments optional. You're talking about the constructors, right? @limited-advantage-32748
  • l

    limited-advantage-32748

    07/30/2020, 8:38 PM
    Yes I am
  • h

    handsome-television-62908

    07/30/2020, 8:39 PM
    It would be nice if haxe had per-class factory methods like Dart does because then haxeui could potentially get around that problem instead allowing you to specify an interface-level constructor.
  • h

    handsome-television-62908

    07/30/2020, 8:41 PM
    This could still be possible with haxeui and haxe, I believe the best solution is adding a macro-level feature for custom components that let a user specify a specific function to be used for framework level construction while we could continue to use our own constructors. I've definitely run into this problem a few times.
  • h

    handsome-television-62908

    07/30/2020, 8:41 PM
    What do you think Ian?
  • b

    bright-gpu-74537

    07/30/2020, 8:42 PM
    The main reason i disallow non optional constructor args is for the xml
  • b

    bright-gpu-74537

    07/30/2020, 8:42 PM
    do you get this error if you arent using xml?
  • l

    limited-advantage-32748

    07/30/2020, 8:43 PM
    I haven't tried an xml and really don't know how to
  • h

    handsome-television-62908

    07/30/2020, 8:43 PM
    I have gotten that error without it
  • b

    bright-gpu-74537

    07/30/2020, 8:43 PM
    oh yeah? Without xml... interesting
  • b

    bright-gpu-74537

    07/30/2020, 8:43 PM
    sounds like its something that can be fixed then
  • l

    limited-advantage-32748

    07/30/2020, 8:44 PM
    ``Building HaxeUIMacroBug Running Pre-Build Command Line... cmd: "C:\HaxeToolkit\haxe/haxelib" run lime build "project.xml" windows -release -Dfdb Warning: Lime version 7.8.0 may not be compatible with OpenFL 8.9.7 (expected version 7.7.*) Use before to include a specific version C:/HaxeToolkit/haxe/lib/haxeui-core/1,1,1/haxe/ui/macros/Macros.hx:320: characters 20-35 : Not enough arguments, expected _someDumbArgumentHere:String src/AClassThatExtendsBoxAndExpectsArguments.hx:9: lines 9-17 : Defined in this class Build halted with errors.`` ``src/AClassThatExtendsBoxAndExpectsArguments.hx:9: lines 9-17 : Defined in this class`` ``C:/HaxeToolkit/haxe/lib/haxeui-core/1,1,1/haxe/ui/macros/Macros.hx:320: characters 20-35 : Not enough arguments, expected _someDumbArgumentHere:String``
  • h

    handsome-television-62908

    07/30/2020, 8:44 PM
    What do you think of having an optionally implementable factory constructor for xml interfaces?
  • h

    handsome-television-62908

    07/30/2020, 8:44 PM
    Instead of defaulting to new
  • l

    limited-advantage-32748

    07/30/2020, 8:44 PM
    Do you want me to submit the issue then?
  • b

    bright-gpu-74537

    07/30/2020, 8:44 PM
    @User - issue sounds good, yeah
  • l

    limited-advantage-32748

    07/30/2020, 8:44 PM
    https://github.com/haxeui/haxeui-core/issues/364
  • b

    bright-gpu-74537

    07/30/2020, 8:45 PM
    looks like its a bug in the macro that builds the component... i presume you must be using a @:build, yeah?
  • l

    limited-advantage-32748

    07/30/2020, 8:45 PM
    I am not
  • b

    bright-gpu-74537

    07/30/2020, 8:45 PM
    oh, you arent
  • b

    bright-gpu-74537

    07/30/2020, 8:45 PM
    thats even stranger
  • l

    limited-advantage-32748

    07/30/2020, 8:45 PM
    minimal code needed was provided as well
  • b

    bright-gpu-74537

    07/30/2020, 8:45 PM
    yeah, got it... thanks
  • b

    bright-gpu-74537

    07/30/2020, 8:45 PM
    > What do you think of having an optionally implementable factory constructor for xml interfaces?
  • b

    bright-gpu-74537

    07/30/2020, 8:45 PM
    in what sense?
  • b

    bright-gpu-74537

    07/30/2020, 8:46 PM
    like
    XmlConstructable<T> { function create():T }
  • h

    handsome-television-62908

    07/30/2020, 8:47 PM
    I don't think it would really need to be anything more than a function actually, no instance would need to be instantiated
  • b

    bright-gpu-74537

    07/30/2020, 8:48 PM
    ah, its the clone function
  • b

    bright-gpu-74537

    07/30/2020, 8:49 PM
    a macro automatically creates a clone function, and that uses "new XYZ()"
  • b

    bright-gpu-74537

    07/30/2020, 8:50 PM
    it it would be easy to add params to that based on the constrcutor... the problem however is what to set them to
1...331332333...1687Latest