Nim: [regression] duplicate member `_i1` codegen bug

Created on 19 Jan 2020  路  3Comments  路  Source: nim-lang/Nim

https://github.com/nim-lang/Nim/pull/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 (https://github.com/nim-lang/Nim/commit/bc14453f69b9bde449cb52655eb6ffe571d6a28b) 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.

Most helpful comment

Should be fixed by https://github.com/nim-lang/Nim/pull/13198.
ggplotnim library is very good by the way.

All 3 comments

I will have a look

Should be fixed by https://github.com/nim-lang/Nim/pull/13198.
ggplotnim library is very good by the way.

@narimiran Please add ggplotnim to the list of important_packages.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wizzardx picture wizzardx  路  4Comments

capocasa picture capocasa  路  3Comments

liquid600pgm picture liquid600pgm  路  3Comments

koki-koba picture koki-koba  路  3Comments

hlaaftana picture hlaaftana  路  3Comments