fixes #18847 [backport] (#18870)

This commit is contained in:
Andreas Rumpf
2021-09-20 09:09:53 +02:00
committed by GitHub
parent 3241df2a13
commit c56ba3f06a
2 changed files with 7 additions and 2 deletions

View File

@@ -1824,8 +1824,9 @@ proc parseRoutine(p: var Parser, kind: TNodeKind): PNode =
# => moves comment `foo` to `fn`
result.comment = body[0].comment
body[0].comment = ""
else:
assert false, p.lex.config$body.info # avoids hard to track bugs, fail early.
#else:
# assert false, p.lex.config$body.info # avoids hard to track bugs, fail early.
# Yeah, that worked so well. There IS a bug in this logic, now what?
proc newCommentStmt(p: var Parser): PNode =
#| commentStmt = COMMENT

View File

@@ -69,3 +69,7 @@ type
MyEnum3* = enum
value5 ## only document the enum value
# bug #18847
proc close*() = ## asdfasdfsdfa
discard ## adsfasdfads