Baseline: tree as shared
This commit is contained in:
1679 files changed
+1024562
No files matched your search
@@ -0,0 +1,26 @@
|
||||
# probe: closures capturing mut state and var snapshots
|
||||
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
|
||||
# expect-stdout: count 4
|
||||
# expect-stdout: count 9
|
||||
# expect-stdout: 101 0
|
||||
def main():
|
||||
var count = 0
|
||||
var step = 2
|
||||
|
||||
def tick() {mut count, imm step}:
|
||||
count += step
|
||||
|
||||
tick()
|
||||
tick()
|
||||
print("count", count)
|
||||
step = 5
|
||||
tick()
|
||||
print("count", count)
|
||||
|
||||
var base = 100
|
||||
|
||||
def from_base(x: Int) {var base} -> Int:
|
||||
return base + x
|
||||
|
||||
base = 0
|
||||
print(from_base(1), base)
|
||||
Reference in new issue
Block a user