Hi, not a DragonRuby developer here, but I think it should be `self.bar += 1` and not `bar += 1` because you are assigning a value to `bar` , otherwise if not prepending `self.`, `bar` is then treated as a local variable:
I tested below, and it works:
```ruby
class Foo
attr_accessor :bar
def initialize
@bar = 0
end
def baz
self.bar += 1
end
end
def tick(args)
args.state.f ||= Foo.new
args.state.f.baz
puts args.state.f.instance_variable_get(:@bar)
end
```
```
1
2
3
4
5
6
7
8
9
...
```
If I changed above into:
```
def baz
bar += 1
end
```
... I get the same errors as yours:
> ERROR. The following hash reached a nil thrashing limit.
However, copying the code into my local mri ruby installation, I get the more familiar error:
> NoMethodError (undefined method `+' for nil:NilClass)
Because `bar += 1 , translates to `bar = bar + 1`, and `bar` at that point is not defined yet, so `bar (undefined) + 1` throws that `nil:NilClass` error.
Having said this though, I think the `mri` error message better described what the error was, though maybe because I'm just not used to DragonRuby errors yet.