Closed
Description
reduced from CI failure in #16988
Example
# t11840b.nim:
template doAssert2*(cond: untyped) =
## foo
runnableExamples:
echo "D20210209T192323"
discard
# main.nim:
import t11840b
doAssert2 true
doAssert2 true
doAssert2 true
nim doc main.nm
Current Output
D20210209T192323
D20210209T192323
D20210209T192323
Expected Output
(nothing)
Additional Information
worked in 0.19.0
fails since 0.19.6 including devel 1.5.1 0d34345
as an example, this prevents adding runnableExamples in doAssert
(refs #16988) but obviously this affects other code, eg when adding runnableExamples to a template.
Note that transforming a proc (that would contain a runnableExamples) to a template shouldn't affect semantics wrt runnableExamples.
Also note that current behavior is bad because it makes it impossible to add runnableExamples to templates without it affecting semantics as demoed here.