fix #19862; make widestrs consistent in refc and orc
This commit is contained in:
parent
25d89269eb
commit
1972005439
2 changed files with 16 additions and 0 deletions
|
|
@ -224,3 +224,6 @@ when defined(nimv2):
|
||||||
|
|
||||||
proc `$`*(s: WideCStringObj): string =
|
proc `$`*(s: WideCStringObj): string =
|
||||||
$(s.data)
|
$(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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue