summary refs log tree commit diff stats
path: root/tests/gc/gcleak4.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-11-25 15:29:41 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-11-26 16:04:28 +0100
commit72237e2bcfc371d917e4e14b22a3c447289ea39f (patch)
tree25922b2b6dc02898657ec9d6399b6c7938e8eb92 /tests/gc/gcleak4.nim
parent879801c63980287070f64d94e4c4f7aeb28cb2f4 (diff)
downloadNim-72237e2bcfc371d917e4e14b22a3c447289ea39f.tar.gz
ARC: ported the GC tests over to --gc:arc
Diffstat (limited to 'tests/gc/gcleak4.nim')
-rw-r--r--tests/gc/gcleak4.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/gc/gcleak4.nim b/tests/gc/gcleak4.nim
index 35b8ce112..aec0218e8 100644
--- a/tests/gc/gcleak4.nim
+++ b/tests/gc/gcleak4.nim
@@ -2,11 +2,11 @@ discard """
   outputsub: "no leak: "
 """
 
-when defined(GC_setMaxPause):
+when declared(GC_setMaxPause):
   GC_setMaxPause 2_000
 
 type
-  TExpr = object {.inheritable.} ## abstract base class for an expression
+  TExpr {.inheritable.} = object ## abstract base class for an expression
   PLiteral = ref TLiteral
   TLiteral = object of TExpr
     x: int
@@ -15,7 +15,7 @@ type
     a, b: ref TExpr
     op2: string
 
-method eval(e: ref TExpr): int =
+method eval(e: ref TExpr): int {.base.} =
   # override this base method
   quit "to override!"
 
@@ -30,7 +30,7 @@ proc newLit(x: int): ref TLiteral =
   result.x = x
   result.op1 = $getOccupiedMem()
 
-proc newPlus(a, b: ref TExpr): ref TPlusExpr =
+proc newPlus(a, b: sink(ref TExpr)): ref TPlusExpr =
   new(result)
   result.a = a
   result.b = b