https://linen.dev logo
Join Discord
Powered by
# react
  • a

    ambitious-knife-25690

    01/15/2020, 8:35 PM
    Doesn't
    PosInfo
    exist in macro world?
  • b

    brainy-machine-50829

    01/15/2020, 8:37 PM
    There is a position and you can have to add position to every expression.
  • b

    brainy-machine-50829

    01/15/2020, 8:37 PM
    But it's not always trivial to know where to source it from.
  • b

    brainy-machine-50829

    01/15/2020, 8:37 PM
    Especially with build macros.
  • b

    brainy-machine-50829

    01/15/2020, 8:38 PM
    Although that case there doesn't look too complex.
  • b

    brainy-machine-50829

    01/15/2020, 8:39 PM
    Thinking about it, I sometimes wish there was a way to have multiple positions. Cos it's not always easy.
  • b

    brainy-machine-50829

    01/15/2020, 8:39 PM
    Like a type being used somewhere that's used in a macro. Error on the type won't say what's wrong. Error on the thing that uses the macro won't tell where the issue is... 😄
  • a

    ambitious-knife-25690

    01/15/2020, 8:40 PM
    I dunno, I could be incredibly wrong cause I don't know anything about macros and I know a macro can expand a line of code quite significantly. But at least show the calling line and not some line later down the chain
  • a

    ambitious-knife-25690

    01/15/2020, 8:41 PM
    Like I know exactly what change I made to cause the error, I don't understand the why and for some reason this error doesn't even make sense 😂
  • a

    ambitious-knife-25690

    01/15/2020, 8:41 PM
    so having the calling line at least for me to stare at and attempt to make some sense of would have been nice lol
  • a

    ambitious-knife-25690

    01/15/2020, 8:42 PM
    Cause I just had to undo all the changes to actually remove the error
  • b

    brainy-machine-50829

    01/15/2020, 8:43 PM
    Yeah I understand. Not always easy.
  • b

    brainy-machine-50829

    01/15/2020, 8:43 PM
    Either laziness, or difficulty, or the ambiguousness I mentioned.
  • u

    user

    01/16/2020, 8:29 AM
    This one is tricky
  • u

    user

    01/16/2020, 8:29 AM
    It's coming from a field reification that uses a type with a @:genericBuild macro and a complex type passed as type parameter
  • u

    user

    01/16/2020, 8:30 AM
    In your case your State isn't an anonymous structure, and it's not supported
  • u

    user

    01/16/2020, 8:31 AM
    What type did you use as State @ambitious-knife-25690 ? Maybe I can catch this earlier to throw a proper error
  • a

    ambitious-knife-25690

    01/16/2020, 3:00 PM
    @User All I wanted to do was pass a type parameter to a component so that I could have a
    BaseComponent
    . So it went something like:
    Copy code
    haxe
    class BaseComponent<Props, State> extends ReactComponentOf<Props, State> {}
    doing:
    Copy code
    haxe
    class BaseComponent<Props:{}, State:{}> extends ReactComponentOf<Props, State> {}
  • a

    ambitious-knife-25690

    01/16/2020, 3:00 PM
    didn't seem to help either
  • a

    ambitious-knife-25690

    01/16/2020, 3:00 PM
    The basecomponent class wasn't the issue though iirc
  • a

    ambitious-knife-25690

    01/16/2020, 3:00 PM
    it was anything used it
  • a

    ambitious-knife-25690

    01/16/2020, 3:01 PM
    Copy code
    haxe
    class FooComponent extends BaseComponent<BaseProps, BaseState> {}
  • u

    user

    01/16/2020, 3:01 PM
    Yeah `ReactComponent`s are not meant to be extended
  • a

    ambitious-knife-25690

    01/16/2020, 3:01 PM
    rip :>
  • b

    bitter-family-72722

    01/16/2020, 3:04 PM
    maybe they should be
    final
    then 😄
  • u

    user

    01/16/2020, 3:05 PM
    Yeah I'm looking at it actually
  • u

    user

    01/16/2020, 3:06 PM
    But when I do something like that I get another error.. it shouldn't let you build if superClass isn't ReactComponent / PureComponent
  • u

    user

    01/16/2020, 3:06 PM
    Maybe the state issue was just coming sooner..
  • u

    user

    01/16/2020, 3:09 PM
    Can I make a class
    final
    in a genericBuild somehow?
  • u

    user

    01/16/2020, 3:12 PM
    (Oh the check only happens with -debug..)
1...313233...80Latest