diff options
author | Clyybber <darkmine956@gmail.com> | 2020-07-04 17:45:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-04 17:45:07 +0200 |
commit | af27e6bdea63bbf66718193ec44bc61e745ded38 (patch) | |
tree | d07edada823019f5cf803099fc314653178a0806 /tests/arc/tarcmisc.nim | |
parent | 1854d29781aff913ca6892cbf73df91b0399397e (diff) | |
download | Nim-af27e6bdea63bbf66718193ec44bc61e745ded38.tar.gz |
Fix #14396 (#14793)
* Correct Left-To-Right evaluation of proc args * Fix CPP backend * Add testcase * closes #14396 * closes #14345 * Improve test and optimize * Improve testcase and optimize literals * Fix bug * Expand testcase and use DFA to optimize * Turn genParams into proc * Turn withTmpIfNeeded into a proc * Cleanup * Fix crash * Better analysis * Cleanup * Trailing newline.. * Fix build * Tiny cleanup Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'tests/arc/tarcmisc.nim')
-rw-r--r-- | tests/arc/tarcmisc.nim | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/tests/arc/tarcmisc.nim b/tests/arc/tarcmisc.nim index e66d9a75f..b6d9d781d 100644 --- a/tests/arc/tarcmisc.nim +++ b/tests/arc/tarcmisc.nim @@ -15,6 +15,7 @@ destroyed: false (x: "8") (x: "9") (x: "10") +0 closed destroying variable ''' @@ -174,38 +175,37 @@ proc bug14495 = bug14495() -when false: - # bug #14396 - type - Spinny = ref object - t: ref int - text: string +# bug #14396 +type + Spinny = ref object + t: ref int + text: string - proc newSpinny*(): Spinny = - Spinny(t: new(int), text: "hello") +proc newSpinny*(): Spinny = + Spinny(t: new(int), text: "hello") - proc spinnyLoop(x: ref int, spinny: sink Spinny) = - echo x[] +proc spinnyLoop(x: ref int, spinny: sink Spinny) = + echo x[] - proc start*(spinny: sink Spinny) = - spinnyLoop(spinny.t, spinny) +proc start*(spinny: sink Spinny) = + spinnyLoop(spinny.t, spinny) - var spinner1 = newSpinny() - spinner1.start() +var spinner1 = newSpinny() +spinner1.start() - # bug #14345 +# bug #14345 - type - SimpleLoopB = ref object - children: seq[SimpleLoopB] - parent: SimpleLoopB +type + SimpleLoopB = ref object + children: seq[SimpleLoopB] + parent: SimpleLoopB - proc addChildLoop(self: SimpleLoopB, loop: SimpleLoopB) = - self.children.add loop +proc addChildLoop(self: SimpleLoopB, loop: SimpleLoopB) = + self.children.add loop - proc setParent(self: SimpleLoopB, parent: SimpleLoopB) = - self.parent = parent - self.parent.addChildLoop(self) +proc setParent(self: SimpleLoopB, parent: SimpleLoopB) = + self.parent = parent + self.parent.addChildLoop(self) - var l = SimpleLoopB() - l.setParent(l) +var l = SimpleLoopB() +l.setParent(l) |