mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
* Field checks for JS backend * Clean nkCall nodes with no arguments Generating a nkEmpty in place of no arguments makes no sense form the AST point of view and also trips up the VM codegen. * Field checks for VM backend * Test case for #6612 This patchset fixes #6612 * Add test case for LHS double evaluation * Prevent LHS double-eval for JS backend * Prevent double evaluation in VM backend
25 lines
434 B
Nim
25 lines
434 B
Nim
discard """
|
|
action: "run"
|
|
"""
|
|
|
|
proc fillWith(sq: var seq[int], n: int, unused: string) =
|
|
sq = @[n]
|
|
|
|
type
|
|
Object = object of RootObj
|
|
case hasNums: bool
|
|
of true:
|
|
numbers: seq[int]
|
|
of false:
|
|
discard
|
|
always: seq[int]
|
|
|
|
var obj = Object(hasNums: true)
|
|
|
|
obj.always.fillWith(5, "unused")
|
|
doAssert obj.always == @[5]
|
|
|
|
obj.numbers.fillWith(3, "unused")
|
|
doAssert obj.numbers == @[3]
|
|
doAssert obj.always == @[5]
|