about summary refs log blame commit diff stats
path: root/immutable-error.mu
blob: 2d25d56e155fa96ec73ba6afbcdcf8c913cf88bb (plain) (tree)
1
2
3
4
5
6
7
8
9



                    
                            


       
                 



                                                                              
# compare mutable.mu

def main [
  local-scope
  x:&:num <- new number:type
  foo x
]

def foo x:&:num [
  local-scope
  load-ingredients
  *x <- copy 34  # will cause an error because x is immutable in this function
]