summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/converter/tconvert.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/converter/tconvert.nim b/tests/converter/tconvert.nim
index 48367a85b..8aa4e97a3 100644
--- a/tests/converter/tconvert.nim
+++ b/tests/converter/tconvert.nim
@@ -18,3 +18,11 @@ converter toPtr*(some: var TFoo): ptr TFoo = (addr some)
 proc zoot(x: ptr TFoo) = discard
 var x: Tfoo
 zoot(x)
+
+# issue #6544
+converter withVar(b: var string): int = ord(b[1])
+
+block:
+  var x = "101"
+  var y: int = x # instantiate withVar
+  doAssert(y == ord('0'))