var a = ""
With `a[0]` you expect to get the null terminator. Neither in old nor in new Nim you are allowed to write to it. With `addr a[0]` you get the address of a null terminator that you are not allowed to write to. You just should not do that. Btw `addr a` is possible though. But it is probably a better way to pass the string as a var parameter.