From 151b9031722360096dca51dd5042ff4ccfabe538 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 12 Jun 2025 21:47:41 +0800 Subject: [PATCH] closes #24992; adds a test case (#24993) closes #24992 --- tests/arc/t23247.nim | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/arc/t23247.nim b/tests/arc/t23247.nim index 0fadc50cd9..9400d48835 100644 --- a/tests/arc/t23247.nim +++ b/tests/arc/t23247.nim @@ -49,4 +49,17 @@ proc setGauge( var nim_gc_mem_bytes = Gauge() let threadID = $getThreadId() setGauge(nim_gc_mem_bytes, @[threadID]) -setGauge(nim_gc_mem_bytes, @[threadID]) \ No newline at end of file +setGauge(nim_gc_mem_bytes, @[threadID]) + + +type + Callback*[C] = proc(value: sink C): uint + Person = object + +proc invoke[C](target: Callback[C], values: sink C): uint = + return target(values) + +proc operation(value: sink (Person, string, int)): uint = + return 123 + +doAssert invoke(operation, (Person(), "Jack", 25)) == 123 \ No newline at end of file