• Kogasa@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      11 months ago

      Discriminated unions have been In The Works™ for quite a while. I believe they were cut from the C# 12 roadmap. But maybe C# 13?

      I think a source-generation based approach similar to OneOf isn’t unlikely.

      • Lmaydev@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        10 months ago

        Yeah unfortunately tacking them onto a 20 year old language is not easy.

        It’s great to see it being worked on but there is a long way to go.

  • nickel@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 months ago

    Does using function as a const? Meaning: when a using variable is declared, is it immutable?