1. Have a method in a class with default arguments,
2. subclass this,
3. overriding the method with 'define_method' with no block arguments.
Problem: calling 'super' won't propagate arguments to the superclass.
Workaround: add an (unused) block argument now the super method argument will be passed correctly.
Tried this with JRuby 1.3, 1.4 and trunk, with both --1.8 and --1.9.
MRI 1.8.7 is fine with this (you don't have to declare unused block arguments to get it working consistently).
Note: as Vladimir pointed out, MRI 1.9.x reports this as error (block arity must match the invocation).
That's probably the more correct behaviour in general.
However, because of a difference on how 1.9 and 1.8 handles blocks arity, I think JRuby should support both:
- in 1.8 mode it should return :override for both invocations.
- in 1.9 mode it should complain as MRI does.