I noticed some very strange behaviour in a class where I was accidentally calling super on a class with no superclass. Obviously I shouldn't have been calling super, but I found the Errors very odd:
class SomeClass
def initialize(someparam)
super
end
end
Then:
SomeClass.new() # ArgumentError: wrong number of arguments (0 for 1)
SomeClass.new('cow') # ArgumentError: wrong number of arguments (1 for 0)
Why does the second Argument error occur and why doesn't a more specific error related to calling super on a non-existant superclass occur?