You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
procmyMegaProc(a: string, b: seq[string] |seq[bool] =@[]) =when a isstring:
discardelif b isseq[string]:
for x in b:
echo x
myMegaProc("hello")
Current Output
CC: hello.nim
In file included from /home/dian/.cache/nim/hello_d/@mhello.nim.c:9:
/home/dian/.cache/nim/hello_d/@mhello.nim.c:82:31: error: conflicting types for 'myMegaProc__lWBnHp6d1v1cWhDKZfWHiQ'
82 | N_LIB_PRIVATE N_NIMCALL(void, myMegaProc__lWBnHp6d1v1cWhDKZfWHiQ)(NimStringDesc* a, tySequence__77YVzYb2AOu2vP0iI0b8Dw* b) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dian/.nim/lib/nimbase.h:250:44: note: in definition of macro 'N_NIMCALL'
250 | # define N_NIMCALL(rettype, name) rettype name /* no modifier */
| ^~~~
/home/dian/.cache/nim/hello_d/@mhello.nim.c:44:31: note: previous declaration of 'myMegaProc__lWBnHp6d1v1cWhDKZfWHiQ' was here
44 | N_LIB_PRIVATE N_NIMCALL(void, myMegaProc__lWBnHp6d1v1cWhDKZfWHiQ)(NimStringDesc* a, TGenericSeq* b);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dian/.nim/lib/nimbase.h:250:44: note: in definition of macro 'N_NIMCALL'
250 | # define N_NIMCALL(rettype, name) rettype name /* no modifier */
| ^~~~
Error: execution of an external compiler program 'gcc -c -w -I/home/dian/.nim/lib -I/home/dian/Projects/skidfix -o /home/dian/.cache/nim/hello_d/@mhello.nim.c.o /home/dian/.cache/nim/hello_d/@mhello.nim.c' failed with exit code: 1
Expected Output
Compiler error message
Additional Information
I consider this to be low-priority because the code is not valid Nim anyway
$ nim -v
Nim Compiler Version 1.3.1 [Linux: amd64]
Compiled at 2020-04-09
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: cc3f5d21b249fe8f96f61369e53e794bf34e65a5
active boot switches: -d:release
The text was updated successfully, but these errors were encountered:
ghost
changed the title
Low-priority codegen bug
Codegen bug with proc with union arguments with default values
Apr 10, 2020
This code errors at C compilation step
Example
Current Output
Expected Output
Compiler error message
Additional Information
The text was updated successfully, but these errors were encountered: