mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 15:31:28 +00:00
fix #19862; make widestrs consistent in refc and orc
This commit is contained in:
@@ -224,3 +224,6 @@ when defined(nimv2):
|
||||
|
||||
proc `$`*(s: WideCStringObj): string =
|
||||
$(s.data)
|
||||
|
||||
proc len*(w: WideCStringObj): int {.inline.} =
|
||||
len(w.data)
|
||||
|
||||
13
tests/arc/t19862.nim
Normal file
13
tests/arc/t19862.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
discard """
|
||||
matrix: "--gc:refc; --gc:arc"
|
||||
"""
|
||||
|
||||
# bug #19862
|
||||
type NewString = object
|
||||
|
||||
proc len(s: NewString): int = 10
|
||||
|
||||
converter toNewString(x: WideCStringObj): NewString = discard
|
||||
|
||||
let w = newWideCString("test")
|
||||
doAssert len(w) == 4
|
||||
Reference in New Issue
Block a user