fix #15663 (#15839) [backport:1.4]

This commit is contained in:
flywind
2020-11-05 21:00:49 +08:00
committed by GitHub
parent a8af664e8b
commit 8e1fa84b0d
2 changed files with 14 additions and 0 deletions

View File

@@ -214,3 +214,10 @@ proc `$`*(w: WideCString, estimate: int, replacement: int = 0xFFFD): string =
proc `$`*(s: WideCString): string =
result = s $ 80
when defined(nimv2):
proc `$`*(s: WideCStringObj, estimate: int, replacement: int = 0xFFFD): string =
`$`(s.data, estimate, replacement)
proc `$`*(s: WideCStringObj): string =
$(s.data)

7
tests/stdlib/t15663.nim Normal file
View File

@@ -0,0 +1,7 @@
discard """
cmd: "nim c --gc:arc $file"
output: "Test"
"""
let ws = newWideCString("Test")
echo ws