Skip to content

template with varargs pragma causes AssertionDefect #587

Open
@demotomohiro

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    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