Files
Nim/tests/modules/treorder.nim
ringabout fd4e3ae3e4 add a prepass for codeReordering (#21513)
* add a prepass for codeReordering

* simplify

* fixes
2023-03-17 08:02:48 +01:00

44 lines
514 B
Nim

discard """
matrix: "-d:testdef"
output: '''works 34
34
defined
3'''
"""
{.experimental: "codeReordering".}
proc bar(x: T)
proc foo() =
bar(34)
whendep()
proc foo(dummy: int) = echo dummy
proc bar(x: T) =
echo "works ", x
foo(x)
when defined(testdef):
proc whendep() = echo "defined"
else:
proc whendep() = echo "undefined"
foo()
type
T = int
when not declared(goo):
proc goo(my, omy) = echo my
when not declared(goo):
proc goo(my, omy) = echo omy
using
my, omy: int
goo(3, 4)