summary refs log tree commit diff stats
path: root/tests/destructor
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-10-20 17:23:09 +0200
committerAraq <rumpf_a@web.de>2017-10-25 17:37:03 +0200
commit14e236af05985516a4ebab10c3b97dfed1d60c8e (patch)
tree2a70e2745cb0caef3d9b986c665fe003232955f9 /tests/destructor
parentaa1b575133961cf55642d8d0418e1683c211bb41 (diff)
downloadNim-14e236af05985516a4ebab10c3b97dfed1d60c8e.tar.gz
don't use .this in tcustomstrings.nim
Diffstat (limited to 'tests/destructor')
-rw-r--r--tests/destructor/tcustomstrings.nim14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/destructor/tcustomstrings.nim b/tests/destructor/tcustomstrings.nim
index 780b0d2f1..449a1e9f2 100644
--- a/tests/destructor/tcustomstrings.nim
+++ b/tests/destructor/tcustomstrings.nim
@@ -13,18 +13,16 @@ type
     len, cap: int
     data: ptr UncheckedArray[char]
 
-{.this: self.}
-
 var
   allocCount, deallocCount: int
 
-proc `=destroy`*(self: var mystring) =
-  if data != nil:
-    dealloc(data)
+proc `=destroy`*(s: var mystring) =
+  if s.data != nil:
+    dealloc(s.data)
     inc deallocCount
-    data = nil
-    len = 0
-    cap = 0
+    s.data = nil
+    s.len = 0
+    s.cap = 0
 
 proc `=sink`*(a: var mystring, b: mystring) =
   # we hope this is optimized away for not yet alive objects: