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

template with varargs pragma causes AssertionDefect #587

Open
demotomohiro opened this issue Feb 20, 2025 · 0 comments
Open

template with varargs pragma causes AssertionDefect #587

demotomohiro opened this issue Feb 20, 2025 · 0 comments

Comments

@demotomohiro
Copy link
Collaborator

mytests/testvarargs.nim:

template foo() {.varargs.} =
  for x in unpack():
    discard x
./bin/nimony  c mytests/testvarargs.nim 
bin/nimsem  --isSystem m nifcache/sysvq0asl.1.nif nifcache/sysvq0asl.2.nif nifcache/sysvq0asl.2.idx.nif
bin/nimsem  m nifcache/tescllp2p1.1.nif nifcache/tescllp2p1.2.nif nifcache/tescllp2p1.2.idx.nif
cc -c   -Ivendor/mimalloc/include vendor/mimalloc/src/static.c -o nifcache/static.o
bin/hexer --bits:64 nifcache/tescllp2p1.2.nif
src/hexer/hexer.nim(94) hexer
src/hexer/hexer.nim(91) handleCmdLine
src/hexer/nifcgen.nim(1415) expand
src/hexer/pipeline.nim(39) transform
src/hexer/iterinliner.nim(411) elimForLoops
src/hexer/iterinliner.nim(378) transformStmt
src/hexer/iterinliner.nim(406) transformStmt
src/hexer/iterinliner.nim(378) transformStmt
src/hexer/iterinliner.nim(383) transformStmt
src/hexer/iterinliner.nim(360) transformForStmt
src/hexer/iterinliner.nim(263) inlineIterator
src/lib/nifcursors.nim symId
src/lib/nifstreams.nim(233) symId
nim-2.3.1/lib/std/assertions.nim(41) failedAssertImpl
nim-2.3.1/lib/std/assertions.nim(34) raiseAssert
Error: unhandled exception: src/lib/nifstreams.nim(233, 3) `n.kind in {Symbol, SymbolDef}`  [AssertionDefect]

echo template in syncio module cannot be compiled due to this issue.

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

No branches or pull requests

1 participant