From 962b2e4b39e92c755975e2e0225fdd7c75fef6d1 Mon Sep 17 00:00:00 2001 From: cooldome <cdome@bk.ru> Date: Thu, 22 Nov 2018 17:33:19 +0000 Subject: Destructors: move into nkTupleConstr and move on tuple unpacking (#9776) --- tests/destructor/t6434.nim | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'tests/destructor/t6434.nim') diff --git a/tests/destructor/t6434.nim b/tests/destructor/t6434.nim index 9c912f1f9..c9ad213c2 100644 --- a/tests/destructor/t6434.nim +++ b/tests/destructor/t6434.nim @@ -1,21 +1,26 @@ discard """ exitcode: 0 - output: '''assingment -assingment -assingment -assingment -''' + output: "" """ type Foo* = object boo: int +var sink_counter = 0 +var assign_counter = 0 + +proc `=sink`(dest: var Foo, src: Foo) = + sink_counter.inc + proc `=`(dest: var Foo, src: Foo) = - debugEcho "assingment" + assign_counter.inc proc test(): auto = var a,b : Foo - return (a, b) + return (a, b, Foo(boo: 5)) + +var (a, b, _) = test() -var (a, b) = test() \ No newline at end of file +doAssert: assign_counter == 0 +doAssert: sink_counter == 9 \ No newline at end of file -- cgit 1.4.1-2-gfad0