From 1655c04aa3b980bf0a9d65bf658c19efa6af7d94 Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Fri, 30 Oct 2020 16:57:02 +0800 Subject: add testcase for #9165 (#15787) --- tests/converter/t9165.nim | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/converter/t9165.nim (limited to 'tests/converter') 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 -- cgit 1.4.1-2-gfad0