fixes #898
This commit is contained in:
parent
b3f390bd48
commit
b56f43c394
3 changed files with 24 additions and 2 deletions
|
|
@ -1048,7 +1048,7 @@ proc discardSons(father: PNode) =
|
|||
father.sons = nil
|
||||
|
||||
when defined(useNodeIds):
|
||||
const nodeIdToDebug* = 482228 # 612794
|
||||
const nodeIdToDebug* = 310841 # 612794
|
||||
#612840 # 612905 # 614635 # 614637 # 614641
|
||||
# 423408
|
||||
#429107 # 430443 # 441048 # 441090 # 441153
|
||||
|
|
|
|||
|
|
@ -864,7 +864,13 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
|
|||
var counter = 0
|
||||
for i in countup(1, n.len - 1):
|
||||
var a = n.sons[i]
|
||||
if a.kind != nkIdentDefs: illFormedAst(a)
|
||||
if a.kind != nkIdentDefs:
|
||||
# for some generic instantiations the passed ':env' parameter
|
||||
# for closures has already been produced (see bug #898). We simply
|
||||
# skip this parameter here. It'll then be re-generated in another LL
|
||||
# pass over this instantiation:
|
||||
if a.kind == nkSym and sfFromGeneric in a.sym.flags: continue
|
||||
illFormedAst(a)
|
||||
checkMinSonsLen(a, 3)
|
||||
var
|
||||
typ: PType = nil
|
||||
|
|
|
|||
16
tests/metatype/tautoproc.nim
Normal file
16
tests/metatype/tautoproc.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# bug #898
|
||||
|
||||
proc measureTime(e: auto) =
|
||||
discard
|
||||
|
||||
proc generate(a: int): void =
|
||||
discard
|
||||
|
||||
proc runExample =
|
||||
var builder: int = 0
|
||||
|
||||
measureTime:
|
||||
builder.generate()
|
||||
|
||||
measureTime:
|
||||
discard
|
||||
Loading…
Add table
Add a link
Reference in a new issue