Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref #20653; fixes chronos empty case branches #23706

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Jun 11, 2024

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 ringabout changed the title fixes #20653; fixes chronos empty case branches ref #20653; fixes chronos empty case branches Jun 14, 2024
@ringabout
Copy link
Member Author

I checked locally #20653 (comment) works

ref status-im/nim-eth#692

@ringabout ringabout marked this pull request as ready for review June 14, 2024 13:50
@Araq Araq merged commit 948bb38 into devel Jun 14, 2024
22 checks passed
@Araq Araq deleted the pr_chronos_variants branch June 14, 2024 13:55
Copy link
Contributor

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

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

narimiran pushed a commit that referenced this pull request Sep 13, 2024
ref #20653

```nim
  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.

(cherry picked from commit 948bb38)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants