Another example of weird code generating a weird result
    
    
    type Foo = ref object
      flag: bool
    
    var test = Foo()
    
    proc setFlag(flag: var bool) =
      test = Foo()
      flag = true
    
    setFlag(test.flag)
    assert(test.flag, "how could this happen?")
    
    
    Run

Reply via email to