misc fixes: remove forceConst (obsolete by static), add more runnableExamples to system (#17896)
* misc fixes * add runnableExamples for compileOption * add runnableExamples for runnableExamples * move tconsteval => tconst * cleanup
This commit is contained in:
parent
1f1d85bb9c
commit
82996aee3f
5 changed files with 78 additions and 88 deletions
|
|
@ -9,16 +9,6 @@ import os
|
|||
import math
|
||||
import strutils
|
||||
|
||||
template forceConst(a: untyped): untyped =
|
||||
## Force evaluation at CT, useful for example here:
|
||||
## `callFoo(forceConst(getBar1()), getBar2())`
|
||||
## instead of:
|
||||
## block:
|
||||
## const a = getBar1()
|
||||
## `callFoo(a, getBar2())`
|
||||
const ret = a
|
||||
ret
|
||||
|
||||
static:
|
||||
# TODO: add more tests
|
||||
block: #getAppFilename, gorgeEx, gorge
|
||||
|
|
@ -51,6 +41,6 @@ static:
|
|||
|
||||
block:
|
||||
# Check against bugs like #9176
|
||||
doAssert getCurrentCompilerExe() == forceConst(getCurrentCompilerExe())
|
||||
doAssert getCurrentCompilerExe() == getCurrentCompilerExe().static
|
||||
if false: #pending #9176
|
||||
doAssert gorgeEx("unexistant") == forceConst(gorgeEx("unexistant"))
|
||||
doAssert gorgeEx("unexistant") == gorgeEx("unexistant").static
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue