summary refs log tree commit diff stats
path: root/tests/converter
diff options
context:
space:
mode:
Diffstat (limited to 'tests/converter')
-rw-r--r--tests/converter/t9165.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/converter/t9165.nim b/tests/converter/t9165.nim
new file mode 100644
index 000000000..d0225ffbc
--- /dev/null
+++ b/tests/converter/t9165.nim
@@ -0,0 +1,11 @@
+type ustring = distinct string
+
+converter toUString(s: string): ustring = ustring(s)
+converter toString(s: ustring): string = string(s)
+
+proc `[]=`*(s: var ustring, slice: Slice[int], replacement: ustring) {.inline.} =
+  s = replacement
+
+var s = ustring("123")
+s[1..2] = "3"
+doAssert s == "3"
\ No newline at end of file