parent
c274d9aed6
commit
1655c04aa3
1 changed files with 11 additions and 0 deletions
11
tests/converter/t9165.nim
Normal file
11
tests/converter/t9165.nim
Normal file
|
|
@ -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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue