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

Passing generic parameter when T=void crashes compiler #3833

Open
zielmicha opened this issue Feb 6, 2016 · 1 comment
Open

Passing generic parameter when T=void crashes compiler #3833

zielmicha opened this issue Feb 6, 2016 · 1 comment

Comments

@zielmicha
Copy link
Contributor

proc bar[T](x: T): string =
  "something"

proc foo[T](x: T) =
  echo bar(x)

foo[void]()

->
Error: internal error: expr: param not init x_101019

This is somewhat related to #402 (feature request for better void handling).

@genotrance
Copy link
Contributor

Stack trace.

Hint: used config file 'c:\users\gt\Desktop\DL\programming\nimdevel\config\nim.cfg' [Conf]
Hint: system [Processing]
Hint: temp [Processing]
temp.nim(7, 12) Error: internal error: expr: param not init x_110020
Traceback (most recent call last)
nim.nim(121)             nim
nim.nim(77)              handleCmdLine
main.nim(173)            mainCommand
main.nim(77)             commandCompileToC
modules.nim(242)         compileProject
modules.nim(182)         compileModule
passes.nim(250)          processModule
passes.nim(139)          processTopLevelStmt
cgen.nim(1375)           myProcess
ccgstmts.nim(1155)       genStmts
ccgexprs.nim(2210)       expr
ccgcalls.nim(549)        genCall
ccgcalls.nim(196)        genPrefixCall
cgen.nim(498)            initLocExpr
ccgexprs.nim(2149)       expr
cgen.nim(895)            genProc
cgen.nim(860)            genProcNoForward
cgen.nim(759)            genProcAux
ccgstmts.nim(1155)       genStmts
ccgexprs.nim(2208)       expr
ccgexprs.nim(1885)       genMagicExpr
ccgexprs.nim(994)        genEcho
cgen.nim(498)            initLocExpr
ccgexprs.nim(2228)       expr
ccgexprs.nim(2004)       genArrayConstr
ccgexprs.nim(2214)       expr
ccgexprs.nim(1840)       genMagicExpr
ccgexprs.nim(2216)       expr
ccgcalls.nim(549)        genCall
ccgcalls.nim(191)        genPrefixCall
ccgcalls.nim(179)        genArgNoParam
cgen.nim(503)            initLocExprSingleUse
ccgexprs.nim(2189)       expr
msgs.nim(1066)           internalError
msgs.nim(1037)           liMessage
msgs.nim(886)            handleError
msgs.nim(876)            quit

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