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
This snippet below fails to compile with gcc. I realize that this is probably adding quite a bit of complexity with the Karax DSL, but I'm not super sure how to minimize further. I was able to get it to fail in the playground as well, on 1.6 and 1.4.8
Example
import karax/[vdom, karaxdsl]
procgenerateInputs[T](obj: T): VNode=buildHtml(tdiv):
for name, placeholder in obj.fieldPairs:
label:
text name
input(type="text", name=name, placeholder=placeholder)
typeRegisterForm=object
name: string
email: stringecho$generateInputs(RegisterForm(name: "ajusa", email: "something@gmail.com"))
Current Output
Exists on devel as well
Hint: used config file '/home/ajusa/.choosenim/toolchains/nim-1.6.0/config/nim.cfg' [Conf]
Hint: used config file '/home/ajusa/.choosenim/toolchains/nim-1.6.0/config/config.nims' [Conf]
..................................................................................
CC: stdlib_digitsutils.nim
CC: stdlib_assertions.nim
CC: stdlib_dollars.nim
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: stdlib_math.nim
CC: stdlib_strutils.nim
CC: ../../.nimble/pkgs/karax-1.2.1/karax/vstyles.nim
CC: ../../.nimble/pkgs/karax-1.2.1/karax/vdom.nim
CC: ../../.nimble/pkgs/karax-1.2.1/karax/compact.nim
CC: testing.nim
/home/ajusa/.cache/nim/testing_d/@mtesting.nim.c: In function ‘generateInputs_testing_12’:
/home/ajusa/.cache/nim/testing_d/@mtesting.nim.c:192:66: error: redeclaration of ‘tmp_2’ with no linkage
192 | tyObject_VNodecolonObjectType___UzLz41HuYz7DVA9bD3pvmag* tmp_2;
| ^~~~~
/home/ajusa/.cache/nim/testing_d/@mtesting.nim.c:187:66: note: previous declaration of ‘tmp_2’ with type ‘tyObject_VNodecolonObjectType___UzLz41HuYz7DVA9bD3pvmag *’
187 | tyObject_VNodecolonObjectType___UzLz41HuYz7DVA9bD3pvmag* tmp_2;
| ^~~~~
/home/ajusa/.cache/nim/testing_d/@mtesting.nim.c:195:66: error: redeclaration of ‘tmp_3’ with no linkage
195 | tyObject_VNodecolonObjectType___UzLz41HuYz7DVA9bD3pvmag* tmp_3;
| ^~~~~
/home/ajusa/.cache/nim/testing_d/@mtesting.nim.c:190:66: note: previous declaration of ‘tmp_3’ with type ‘tyObject_VNodecolonObjectType___UzLz41HuYz7DVA9bD3pvmag *’
190 | tyObject_VNodecolonObjectType___UzLz41HuYz7DVA9bD3pvmag* tmp_3;
| ^~~~~
Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -I/home/ajusa/.choosenim/toolchains/nim-1.6.0/lib -I/home/ajusa/Documents/example -o /home/ajusa/.cache/nim/testing_d/@mtesting.nim.c.o /home/ajusa/.cache/nim/testing_d/@mtesting.nim.c' failed with exit code: 1
Expected Output
Not sure, but it should be some HTML code. At the very least I should get a Nim compiler error or correct output.
$ nim -v
Nim Compiler Version 1.6.0 [Linux: amd64]
Compiled at 2021-10-19
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: 727c6378d2464090564dbcd9bc8b9ac648467e38
active boot switches: -d:release
Might be related to #15637, it has a similar error message but the code is very different. Interestingly, if I make the type only have one field (such as name, without email) then it compiles and runs just fine.
The text was updated successfully, but these errors were encountered:
This snippet below fails to compile with
gcc
. I realize that this is probably adding quite a bit of complexity with the Karax DSL, but I'm not super sure how to minimize further. I was able to get it to fail in the playground as well, on 1.6 and 1.4.8Example
Current Output
Exists on devel as well
Expected Output
Not sure, but it should be some HTML code. At the very least I should get a Nim compiler error or correct output.
Might be related to #15637, it has a similar error message but the code is very different. Interestingly, if I make the type only have one field (such as name, without email) then it compiles and runs just fine.
The text was updated successfully, but these errors were encountered: