fix #17615(runnableExamples silently ignored if placed after some code) (#17619)

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
flywind
2021-04-03 09:26:30 +08:00
committed by GitHub
parent e35946f306
commit a807233aeb
8 changed files with 41 additions and 28 deletions

11
tests/nimdoc/t17615.nim Normal file
View File

@@ -0,0 +1,11 @@
discard """
cmd: "nim doc -r $file"
errormsg: "runnableExamples must appear before the first non-comment statement"
line: 10
"""
func fn*() =
## foo
discard
runnableExamples:
assert true