Somehow the test case doesn't crash anymore and the regression in the
doc generation is fixed.

Fixes #9019
This commit is contained in:
LemonBoy 2018-09-19 21:17:48 +02:00
commit 4d9aec1858
6 changed files with 59 additions and 13 deletions

View file

@ -495,12 +495,8 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
# keep documentation information:
b.comment = a.comment
addSon(b, newSymNode(v))
# keep type desc for doc generator, but only if the user explicitly
# added it
if a.sons[length-2].kind != nkEmpty:
addSon(b, newNodeIT(nkType, a.info, typ))
else:
addSon(b, a.sons[length-2])
# keep type desc for doc generator
addSon(b, a.sons[length-2])
addSon(b, copyTree(def))
addToVarSection(c, result, n, b)
else: