mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
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"
|
||||
Reference in New Issue
Block a user