Skip to content

[regression] duplicate member _i1 codegen bug #13195

Closed
@Vindaar

Description

@Vindaar

#13178 introduced a codegen bug.

Example

I don't have a simple contained example ready. But for instance compiling one of the test files of ggplotnim causes the codegen error below.

git clone https://github.com/vindaar/ggplotnim
cd ggplotnim 
nim c tests/tests.nim

Current Output

Error: execution of an external compiler program 'gcc -c  -w   -I/home/basti/src/nim/nim_git_repo/lib -I/home/basti/CastData/ExternCode/ggplotnim/tests -o /home/basti/.cache/nim/tests_d/stdlib_dollars.nim.c.o /home/basti/.cache/nim/tests_d/stdlib_dollars.nim.c' failed with exit code: 1

/home/basti/.cache/nim/tests_d/stdlib_dollars.nim.c:159:3: error: duplicate member '_i1'
  159 | } _i1;
      |   ^~~

Expected Output

No codegen errors. :)

Possible Solution

Not sure how to properly solve it, but it's related to the changes here:
https://github.com/nim-lang/Nim/blob/devel/compiler/ccgtypes.nim#L528-L538

Additional Information

The commit before (bc14453) still works fine.

Let me know if a simple example would be helpful. For the time being I'd rather avoid trying to build a minimal example from this. Looking at the changed code I assume it's a simple bug.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions