mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-28 02:03:59 +00:00
defines the gcRefc symbol which allows writing specific code for refc (#20009)
* define gcRefc symbols * add comments * add a changelog item * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update changelog.md Co-authored-by: Yardanico <tiberiumk12@gmail.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Yardanico <tiberiumk12@gmail.com>
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
discard """
|
||||
matrix: "--gc:refc; --gc:orc"
|
||||
"""
|
||||
|
||||
import "$lib/.." / compiler/strutils2
|
||||
|
||||
block: # setLen
|
||||
var a = "abc"
|
||||
a.setLen 0
|
||||
a.setLen 3, isInit = false
|
||||
doAssert a[1] == 'b'
|
||||
when defined(gcRefc): # bug #19763
|
||||
doAssert a[1] == 'b'
|
||||
a.setLen 0
|
||||
a.setLen 3, isInit = true
|
||||
doAssert a[1] == '\0'
|
||||
|
||||
Reference in New Issue
Block a user