nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.22k stars 1.46k forks source link

ref #20653; fixes chronos empty case branches #23706

Closed ringabout closed 2 weeks ago

ringabout commented 2 weeks ago

ref #20653

  Error* = object
    case kind*: ErrorType
    of ErrorA:
      discard
    of ErrorB:
      discard

For an object variants without fields, it shouldn't generate empty brackets for default values since there are no fields at all in case branches.

ringabout commented 2 weeks ago

I checked locally https://github.com/nim-lang/Nim/issues/20653#issuecomment-2160227451 works

ref https://github.com/status-im/nim-eth/pull/692

github-actions[bot] commented 2 weeks ago

Thanks for your hard work on this PR! The lines below are statistics of the Nim compiler built from 948bb38335985c2c873612e66e2e054ef0573b58

Hint: mm: orc; opt: speed; options: -d:release 178762 lines; 8.367s; 664.242MiB peakmem