summary refs log tree commit diff stats
path: root/tests/overload/toverl4.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2022-10-14 12:00:38 +0200
committerGitHub <noreply@github.com>2022-10-14 12:00:38 +0200
commit07b645342abd06b2323df042c170eb847f51880d (patch)
tree2645d5edd83defbdb46474de8bf8d9619132bba0 /tests/overload/toverl4.nim
parentb793ca739448ba35b59c43b85706f1d202b31788 (diff)
downloadNim-07b645342abd06b2323df042c170eb847f51880d.tar.gz
fixes #3748 (#20563)
* fixes #3748

* fix the regression

* don't use the new allocator for the SSL wrapper

* fixes regression
Diffstat (limited to 'tests/overload/toverl4.nim')
-rw-r--r--tests/overload/toverl4.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/overload/toverl4.nim b/tests/overload/toverl4.nim
index 537925674..455a73515 100644
--- a/tests/overload/toverl4.nim
+++ b/tests/overload/toverl4.nim
@@ -75,3 +75,17 @@ proc add*[TKey, TData](root: var PElement[TKey, TData], key: TKey, data: TData)
 var tree = PElement[int, int](kind: ElementKind.inner, key: 0, left: nil, right: nil)
 let result = add(tree, 1, 1)
 echo(result)
+
+# bug #3748
+type
+  Foo = object
+    bar: int
+
+proc bar(cur: Foo, val: int, s:seq[string]) =
+  discard cur.bar
+
+proc does_fail(): Foo =
+  let a = @["a"]
+  result.bar(5, a)
+
+doAssert does_fail().bar == 0