https://linen.dev logo
Join Discord
Powered by
# ceramic
  • But then the macros?
    m

    miniature-lawyer-98519

    03/29/2023, 9:37 PM
    But then the macros?
  • Like typedef?
    m

    miniature-lawyer-98519

    03/29/2023, 9:37 PM
    Like typedef?
  • C: is like extends?
    m

    miniature-lawyer-98519

    03/29/2023, 9:37 PM
    C: is like extends?
  • C is a generic type
    b

    billowy-waiter-28954

    03/29/2023, 9:37 PM
    C is a generic type
  • C:Component means the method accepts a generic type that is of type Component
    b

    billowy-waiter-28954

    03/29/2023, 9:38 PM
    C:Component means the method accepts a generic type that is of type Component
  • Cool
    m

    miniature-lawyer-98519

    03/29/2023, 9:38 PM
    Cool
  • but the return type is correctly inferred
    b

    billowy-waiter-28954

    03/29/2023, 9:38 PM
    but the return type is correctly inferred
  • Bummer
    m

    miniature-lawyer-98519

    03/29/2023, 9:38 PM
    Bummer
  • The thing is
    b

    billowy-waiter-28954

    03/29/2023, 9:38 PM
    The thing is
  • that works when you assign the component
    b

    billowy-waiter-28954

    03/29/2023, 9:38 PM
    that works when you assign the component
  • but if you do: ```haxe var comp = entity.component('myComponent'); ```
    b

    billowy-waiter-28954

    03/29/2023, 9:38 PM
    but if you do:
    Copy code
    haxe
    var comp = entity.component('myComponent');
  • it cannot infer the type
    b

    billowy-waiter-28954

    03/29/2023, 9:39 PM
    it cannot infer the type
  • But using assing and return for the same@purpose is weird as well
    m

    miniature-lawyer-98519

    03/29/2023, 9:39 PM
    But using assing and return for the same@purpose is weird as well
  • <>
    m

    miniature-lawyer-98519

    03/29/2023, 9:39 PM
    <>
  • b

    billowy-waiter-28954

    03/29/2023, 9:39 PM

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

  • Obviously expected
    m

    miniature-lawyer-98519

    03/29/2023, 9:39 PM
    Obviously expected
  • If u pass the C?
    m

    miniature-lawyer-98519

    03/29/2023, 9:40 PM
    If u pass the C?
  • To the method call
    m

    miniature-lawyer-98519

    03/29/2023, 9:40 PM
    To the method call
  • logo.component<RotateVisual>()
    m

    miniature-lawyer-98519

    03/29/2023, 9:40 PM
    logo.component()
  • Um, that is weird
    b

    billowy-waiter-28954

    03/29/2023, 9:40 PM
    Um, that is weird

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

  • It is
    m

    miniature-lawyer-98519

    03/29/2023, 9:40 PM
    It is
  • I resolves as Dynamic if I specify the type
    b

    billowy-waiter-28954

    03/29/2023, 9:40 PM
    I resolves as Dynamic if I specify the type
  • Haxe bug
    m

    miniature-lawyer-98519

    03/29/2023, 9:41 PM
    Haxe bug
  • Haha
    m

    miniature-lawyer-98519

    03/29/2023, 9:41 PM
    Haha
  • What about comp: RotateVisual=
    m

    miniature-lawyer-98519

    03/29/2023, 9:41 PM
    What about comp: RotateVisual=
  • Yeah that works
    b

    billowy-waiter-28954

    03/29/2023, 9:42 PM
    Yeah that works

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

  • it doesn't need the explicit `cast` anymore
    b

    billowy-waiter-28954

    03/29/2023, 9:42 PM
    it doesn't need the explicit
    cast
    anymore
  • which is still better than before
    b

    billowy-waiter-28954

    03/29/2023, 9:42 PM
    which is still better than before
  • I'll keep the change locally and test it on wider code bases
    b

    billowy-waiter-28954

    03/29/2023, 9:42 PM
    I'll keep the change locally and test it on wider code bases
  • maybe that's a cool way to promote the usage of Types over ids?
    m

    miniature-lawyer-98519

    03/29/2023, 9:43 PM
    maybe that's a cool way to promote the usage of Types over ids?
1...104105106...124Latest