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

Error: internal error #6533

ghost opened this Issue Oct 19, 2017 · 1 comment


None yet
2 participants
Copy link

ghost commented Oct 19, 2017

type Value[T: static[int]] = typedesc
proc foo(order: Value[1]): auto = 0
echo foo(Value[1])

Error log (./koch temp):

Error: internal error: (filename: semtypes.nim, line: 897)
Traceback (most recent call last)
nim.nim(121)             nim
nim.nim(77)              handleCmdLine
main.nim(167)            mainCommand
main.nim(74)             commandCompileToC
modules.nim(240)         compileProject
modules.nim(180)         compileModule
passes.nim(217)          processModule
passes.nim(135)          processTopLevelStmt
sem.nim(552)             myProcess
sem.nim(524)             semStmtAndGenerateGenerics
semstmts.nim(1865)       semStmt
semexprs.nim(783)        semExprNoType
semexprs.nim(2337)       semExpr
semstmts.nim(1627)       semProc
semstmts.nim(1460)       semProcAux
semstmts.nim(1071)       semParamList
semtypes.nim(1003)       semProcTypeNode
msgs.nim(1061)           liftParamType
msgs.nim(1054)           internalError
msgs.nim(951)            rawMessage
msgs.nim(948)            rawMessage
msgs.nim(872)            handleError
msgs.nim(862)            quit

This comment has been minimized.

Copy link

Yardanico commented Oct 19, 2017

@BTaskaya yeah, compiler shouldn't crash there, but your code is invalid since "type value ... = typedesc" is not a concrete type and also because you're trying to call foo with a Value[1], which is not an object, but a typedesc (however, your proc doesn't accept a typedesc)

@Araq Araq added this to the v1 milestone Jun 8, 2018

@Araq Araq closed this in f673fbd Oct 2, 2018

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