transformed {.reorder: on.} into {.experimental: codeReordering.}, added tests
This commit is contained in:
parent
1d93991929
commit
e6a4213fae
5 changed files with 24 additions and 12 deletions
|
|
@ -6,7 +6,8 @@ output:'''0
|
|||
"""
|
||||
|
||||
import macros
|
||||
{.reorder: on .}
|
||||
# {.reorder: on .}
|
||||
{.experimental: "codeReordering".}
|
||||
|
||||
echo foo(-1)
|
||||
echo callWithFoo(0)
|
||||
|
|
@ -71,4 +72,4 @@ macro make(arg: untyped): untyped =
|
|||
proc first(i: int): void =
|
||||
make(second)
|
||||
|
||||
var ss {.compileTime.}: string = ""
|
||||
var ss {.compileTime.}: string = ""
|
||||
|
|
|
|||
12
tests/pragmas/treorderdeclared.nim
Normal file
12
tests/pragmas/treorderdeclared.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
discard """
|
||||
output:'''false'''
|
||||
"""
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
|
||||
proc x() =
|
||||
echo(declared(foo))
|
||||
|
||||
var foo = 4
|
||||
|
||||
x() # "false", the same as it would be with code reordering OFF
|
||||
Loading…
Add table
Add a link
Reference in a new issue