* fixes #18645; C Compiler error when initializing {.global.} with a block: * arguably cleaner solution Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com> Co-authored-by: Araq <rumpf_a@web.de>
This commit is contained in:
parent
852a7c4919
commit
0f5ad49971
2 changed files with 35 additions and 12 deletions
18
tests/arc/t18645.nim
Normal file
18
tests/arc/t18645.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
discard """
|
||||
matrix: "--gc:arc; --gc:refc"
|
||||
output: '''
|
||||
1
|
||||
2
|
||||
3
|
||||
'''
|
||||
"""
|
||||
|
||||
proc bitTypeIdUnion() =
|
||||
var bitId {.global.} = block:
|
||||
0
|
||||
inc bitId
|
||||
echo bitId
|
||||
|
||||
bitTypeIdUnion()
|
||||
bitTypeIdUnion()
|
||||
bitTypeIdUnion()
|
||||
Loading…
Add table
Add a link
Reference in a new issue