summary refs log tree commit diff stats
path: root/tests/converter/t9165.nim
blob: d0225ffbcd32d1f306a7f404a5b700907b740d58 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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"