https://linen.dev logo
Join Discord
Powered by
# ceramic
  • Obviously
    m

    miniature-lawyer-98519

    03/29/2023, 9:23 PM
    Obviously
  • U put a ton shit of hours on that mate, kudos
    m

    miniature-lawyer-98519

    03/29/2023, 9:23 PM
    U put a ton shit of hours on that mate, kudos
  • so if i add that click component which is already assigned in the hashmap
    m

    miniature-lawyer-98519

    03/29/2023, 9:24 PM
    so if i add that click component which is already assigned in the hashmap
  • I would expect it to return me that instance no?
    m

    miniature-lawyer-98519

    03/29/2023, 9:24 PM
    I would expect it to return me that instance no?
  • i would make the name/id secondary to the type
    m

    miniature-lawyer-98519

    03/29/2023, 9:25 PM
    i would make the name/id secondary to the type
  • If u ever needed that
    m

    miniature-lawyer-98519

    03/29/2023, 9:25 PM
    If u ever needed that
  • And consume by types the components
    m

    miniature-lawyer-98519

    03/29/2023, 9:25 PM
    And consume by types the components
  • U can infer types in haxe?
    m

    miniature-lawyer-98519

    03/29/2023, 9:26 PM
    U can infer types in haxe?
  • 2023 dart has no macros, haxe no inferrance!
    m

    miniature-lawyer-98519

    03/29/2023, 9:26 PM
    2023 dart has no macros, haxe no inferrance!
  • Haxe does have type inference
    b

    billowy-waiter-28954

    03/29/2023, 9:27 PM
    Haxe does have type inference
  • But this specific case is tricky
    b

    billowy-waiter-28954

    03/29/2023, 9:27 PM
    But this specific case is tricky
  • ok
    m

    miniature-lawyer-98519

    03/29/2023, 9:28 PM
    ok
  • the function declaration of component() is `function component(?name:String, ?component:Component):Component`
    b

    billowy-waiter-28954

    03/29/2023, 9:29 PM
    the function declaration of component() is
    function component(?name:String, ?component:Component):Component
  • Yep
    m

    miniature-lawyer-98519

    03/29/2023, 9:29 PM
    Yep
  • because I expect to have a `Component` type
    b

    billowy-waiter-28954

    03/29/2023, 9:29 PM
    because I expect to have a
    Component
    type
  • but if I wanted the type to be inferred in return
    b

    billowy-waiter-28954

    03/29/2023, 9:29 PM
    but if I wanted the type to be inferred in return
  • U cant say <T extends Component>?
    m

    miniature-lawyer-98519

    03/29/2023, 9:29 PM
    U cant say ?
  • I'd rather have to do this: ```haxe function component<T>(?name:String, ?component:T):T ``` But then it would accept any type not only components
    b

    billowy-waiter-28954

    03/29/2023, 9:30 PM
    I'd rather have to do this:
    Copy code
    haxe
    function component<T>(?name:String, ?component:T):T
    But then it would accept any type not only components
  • Cant enforce?
    m

    miniature-lawyer-98519

    03/29/2023, 9:30 PM
    Cant enforce?
  • here it's more <T implements Component>
    b

    billowy-waiter-28954

    03/29/2023, 9:30 PM
    here it's more
  • Actually I don't know so much if we can do this with haxe
    b

    billowy-waiter-28954

    03/29/2023, 9:31 PM
    Actually I don't know so much if we can do this with haxe
  • Haxe has the <T:ParentType> syntax I believe
    b

    billowy-waiter-28954

    03/29/2023, 9:33 PM
    Haxe has the syntax I believe
  • But I might have tried to use that in the past and have more problems, don't remember so well
    b

    billowy-waiter-28954

    03/29/2023, 9:33 PM
    But I might have tried to use that in the past and have more problems, don't remember so well
  • No worries
    m

    miniature-lawyer-98519

    03/29/2023, 9:36 PM
    No worries
  • Would make the experience a little cleaner though if u dont have to cast
    m

    miniature-lawyer-98519

    03/29/2023, 9:36 PM
    Would make the experience a little cleaner though if u dont have to cast
  • Mmmmh
    b

    billowy-waiter-28954

    03/29/2023, 9:36 PM
    Mmmmh
  • b

    billowy-waiter-28954

    03/29/2023, 9:36 PM

    https://cdn.discordapp.com/attachments/853414608747364352/1090751410410369104/image.png▾

  • Just trying
    b

    billowy-waiter-28954

    03/29/2023, 9:36 PM
    Just trying
  • small test seems to work
    b

    billowy-waiter-28954

    03/29/2023, 9:36 PM
    small test seems to work
  • b

    billowy-waiter-28954

    03/29/2023, 9:37 PM

    https://cdn.discordapp.com/attachments/853414608747364352/1090751560058933278/image.png▾

1...103104105...124Latest