Closed SBBerkov closed 6 years ago
Fails for me with a proper error message (I'm on OSX though):
temp3.nim(70, 23) Error: type mismatch: got (Element)
but expected one of:
proc `$`(x: int): string
proc `$`[T: tuple |
object](x: T): string
proc `$`[T](x: seq[T]): string
proc `$`(x: uint64): string
proc `$`[T](x: set[T]): string
proc `$`(x: int64): string
proc `$`(s: WideCString): string
proc `$`(x: string): string
proc `$`(x: char): string
proc `$`(x: cstring): string
proc `$`(x: bool): string
proc `$`[Enum: enum](x: Enum): string
proc `$`(x: float): string
proc `$`(w: WideCString; estimate: int; replacement: int = 0x0000FFFD): string
proc `$`[A, B](t: Table[A, B]): string
proc `$`[A, B](t: OrderedTable[A, B]): string
proc `$`[A, B](t: TableRef[A, B]): string
proc `$`[A](t: CountTableRef[A]): string
proc `$`[A](t: CountTable[A]): string
proc `$`[A, B](t: OrderedTableRef[A, B]): string
after recompile nim with -d:debug I get:
nim c -r test.nim
Hint: used config file '/home/sbelyak/work/xored/Nim/config/nim.cfg' [Conf]
Hint: used config file '/home/sbelyak/work/xored/datafabric/ferma/src/ssh_grain/nim.cfg' [Conf]
Hint: system [Processing]
Hint: test [Processing]
Hint: tables [Processing]
Hint: hashes [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: algorithm [Processing]
Hint: etcpriv [Processing]
Hint: parsexml [Processing]
Hint: lexbase [Processing]
Hint: streams [Processing]
Hint: unicode [Processing]
Traceback (most recent call last)
nim.nim(121) nim
nim.nim(77) handleCmdLine
main.nim(163) mainCommand
main.nim(74) commandCompileToC
modules.nim(240) compileProject
modules.nim(180) compileModule
passes.nim(213) processModule
passes.nim(135) processTopLevelStmt
sem.nim(507) myProcess
sem.nim(479) semStmtAndGenerateGenerics
semstmts.nim(1609) semStmt
semexprs.nim(819) semExprNoType
semexprs.nim(2360) semExpr
semstmts.nim(1380) semProc
semstmts.nim(1314) semProcAux
semexprs.nim(1429) semProcBody
semexprs.nim(2342) semExpr
semstmts.nim(1563) semStmtList
semexprs.nim(2354) semExpr
semexprs.nim(1417) semReturn
semexprs.nim(1385) semAsgn
semexprs.nim(42) semExprWithType
semexprs.nim(2263) semExpr
semexprs.nim(802) semDirectOp
semexprs.nim(640) semOverloadedCallAnalyseEffects
semcall.nim(384) semOverloadedCall
semcall.nim(199) resolveOverloads
semcall.nim(87) pickBestCandidate
sigmatch.nim(1789) matches
sigmatch.nim(1746) matchesAux
sigmatch.nim(1583) prepareOperand
(1874 calls omitted) ...
sigmatch.nim(1746) matchesAux
sigmatch.nim(1583) prepareOperand
semexprs.nim(26) semOperand
semexprs.nim(2275) semExpr
semexprs.nim(802) semDirectOp
semexprs.nim(640) semOverloadedCallAnalyseEffects
semcall.nim(390) semOverloadedCall
semcall.nim(353) semResolvedCall
seminst.nim(296) generateInstance
seminst.nim(136) instantiateBody
semexprs.nim(1429) semProcBody
semexprs.nim(2342) semExpr
semstmts.nim(1563) semStmtList
semexprs.nim(2352) semExpr
semstmts.nim(670) semFor
semfields.nim(153) semForFields
semfields.nim(100) semForObjectFields
semfields.nim(71) semForObjectFields
semstmts.nim(1609) semStmt
semexprs.nim(819) semExprNoType
semexprs.nim(2342) semExpr
semstmts.nim(1563) semStmtList
semexprs.nim(2282) semExpr
semexprs.nim(1874) semWhen
sem.nim(303) semConstExpr
semexprs.nim(42) semExprWithType
semexprs.nim(2264) semExpr
semexprs.nim(1780) semMagic
semexprs.nim(1723) semCompiles
semexprs.nim(1698) tryExpr
semexprs.nim(2275) semExpr
semexprs.nim(802) semDirectOp
semexprs.nim(640) semOverloadedCallAnalyseEffects
semcall.nim(385) semOverloadedCall
semcall.nim(353) semResolvedCall
seminst.nim(296) generateInstance
seminst.nim(136) instantiateBody
semexprs.nim(1429) semProcBody
semexprs.nim(2342) semExpr
semstmts.nim(1563) semStmtList
semexprs.nim(2342) semExpr
semstmts.nim(1563) semStmtList
semexprs.nim(2323) semExpr
semstmts.nim(182) semIf
semstmts.nim(120) semExprBranchScope
semstmts.nim(111) semExprBranch
semexprs.nim(2342) semExpr
semstmts.nim(1563) semStmtList
semexprs.nim(2352) semExpr
semstmts.nim(661) semFor
semexprs.nim(58) semExprNoDeref
semexprs.nim(2275) semExpr
semexprs.nim(802) semDirectOp
semexprs.nim(637) semOverloadedCallAnalyseEffects
semcall.nim(385) semOverloadedCall
semcall.nim(353) semResolvedCall
seminst.nim(296) generateInstance
seminst.nim(136) instantiateBody
semexprs.nim(1429) semProcBody
semexprs.nim(2342) semExpr
semstmts.nim(1563) semStmtList
semexprs.nim(2352) semExpr
semstmts.nim(661) semFor
semexprs.nim(58) semExprNoDeref
semexprs.nim(2275) semExpr
semexprs.nim(802) semDirectOp
semexprs.nim(637) semOverloadedCallAnalyseEffects
semcall.nim(385) semOverloadedCall
semcall.nim(353) semResolvedCall
seminst.nim(296) generateInstance
seminst.nim(136) instantiateBody
semexprs.nim(1429) semProcBody
semexprs.nim(2342) semExpr
semstmts.nim(1563) semStmtList
semexprs.nim(2342) semExpr
semstmts.nim(1563) semStmtList
semexprs.nim(2287) semExpr
semexprs.nim(2342) semExpr
semstmts.nim(1563) semStmtList
semexprs.nim(2349) semExpr
semstmts.nim(58) semWhile
semexprs.nim(42) semExprWithType
semexprs.nim(2275) semExpr
semexprs.nim(802) semDirectOp
semexprs.nim(640) semOverloadedCallAnalyseEffects
semcall.nim(384) semOverloadedCall
semcall.nim(199) resolveOverloads
semcall.nim(87) pickBestCandidate
sigmatch.nim(1789) matches
sigmatch.nim(1643) matchesAux
ast.nim(1468) copyTree
ast.nim(1451) copyTree
ast.nim(1002) newNode
gc.nim(503) newObj
alloc.nim(517) rawAlloc
osalloc.nim roundup
Stack overflow
Please use triple backticks around multi-line code blocks. It makes it much easier to read and doesn't butcher the formatting.
@SBBerkov I fixed your comment's formatting for you, hope you don't mind :)
Can't reproduce issue: ie proper error message same as @Araq Changing
return parseMessage($elements[0])
to
return parseMessage($elements[0][]) # ref value need to be dereferenced.
produce the expected output: COMPILED!
platform: Linux XXXX 4.6.4-040604-generic
Nim Compiler Version 0.17.0 (2017-05-31) [Linux: amd64]
Copyright (c) 2006-2017 by Andreas Rumpf
git hash: fd0ab1df3efa51870d6746ed0ce6479f8934369d
active boot switches: -d:release
@Araq maybe close? seems to be fixed as well (even if compiled with -d:debug)
I know the underlying problem is still an issue.
Duplicate of the "infinite instantiation" bug. Closing.
Can't compile file netconfutils.nim with
My system is:
$uname -a Linux x220 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
and in console i get
if I commit plainSeq proc all work fine.