bindsym to void template produces ICE #4808

yglukhov opened this Issue Sep 20, 2016 · 1 comment


None yet

1 participant

import macros
template bar() = discard
macro foo(): untyped =
    discard bindsym"bar"
Error: internal error: (filename: compiler/sempass2.nim, line: 546)
Traceback (most recent call last)
nim.nim(115)             nim
nim.nim(71)              handleCmdLine
main.nim(254)            mainCommand
main.nim(65)             commandCompileToC
modules.nim(238)         compileProject
system.nim(1105)         compileModule
passes.nim(198)          processModule
passes.nim(131)          processTopLevelStmt
sem.nim(492)             myProcess
sem.nim(464)             semStmtAndGenerateGenerics
semstmts.nim(1567)       semStmt
semexprs.nim(817)        semExprNoType
semexprs.nim(2355)       semExpr
semstmts.nim(1395)       semMacroDef
semstmts.nim(1277)       semProcAux
transf.nim(925)          transformBody
sempass2.nim(902)        trackProc
sempass2.nim(810)        track
sempass2.nim(724)        track
msgs.nim(1006)           trackOperand
msgs.nim(999)            internalError
msgs.nim(904)            rawMessage
msgs.nim(901)            rawMessage
msgs.nim(840)            handleError
msgs.nim(824)            quit

The issue can be worked around by adding some return type (typed/untyped/etc) to bar.

@Araq Araq added a commit that closed this issue Oct 21, 2016
@Araq Araq fixes #4808 c247b50
@Araq Araq closed this in c247b50 Oct 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment