mirror of
https://github.com/nim-lang/Nim.git
synced 2026-09-03 04:13:40 +00:00
fixes #26143
follows up https://github.com/nim-lang/Nim/pull/20307
(cherry picked from commit c36c527db3)
This commit is contained in:
@@ -35,6 +35,20 @@ proc bug20303() =
|
||||
|
||||
bug20303()
|
||||
|
||||
block: # bug #26143
|
||||
var indexCalls = 0
|
||||
|
||||
proc nextIndex(): int =
|
||||
result = indexCalls
|
||||
inc indexCalls
|
||||
|
||||
proc consume(value: sink string) =
|
||||
doAssert value == "A"
|
||||
|
||||
var values = @["A", "B"]
|
||||
consume(values[nextIndex()])
|
||||
doAssert indexCalls == 1
|
||||
|
||||
proc main() = # todo bug with templates
|
||||
block: # bug #11267
|
||||
var a: seq[char] = block: @[]
|
||||
|
||||
Reference in New Issue
Block a user