mu/immutable-error.mu

14 lines
219 B
Plaintext
Raw Normal View History

# compare mutable.mu
def main [
local-scope
2016-09-17 19:55:10 +00:00
x:&:num <- new number:type
foo x
]
2016-09-17 19:55:10 +00:00
def foo x:&:num [
local-scope
load-ingredients
*x <- copy 34 # will cause an error because x is immutable in this function
]