Open
Description
$ ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
$ ruby mygame/app/main.rb
Super Bad:4 5 6
Super Good:4 5 6
# this was on 2.11
$ ./dragonruby
** INFO: =app/main.rb= queued to load via ~require~. (-1, -1)
Super Bad:4 2 3
Super Good:4 5 6
using this source
class Parent
def foo(a=1, b: 2, c:3)
"#{a} #{b} #{c}"
end
def foo2(a=1, b: 2, c:3)
"#{a} #{b} #{c}"
end
end
class Child < Parent
def foo(a=1, b: 2, c:3)
super
end
def foo2(a=1, b: 2, c:3)
super(a, b:b, c:c)
end
end
puts "Super Bad:" + Child.new.foo(4, b:5, c:6)
puts "Super Good:" + Child.new.foo2(4, b:5, c:6)
def tick a
end
https://ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/syntax.html#super
I ran into this when building a subclass off of https://github.com/danhealy/dragonruby-zif/blob/16b5b2daebe30b0aaf5684e285f2bdd3879e349b/app/lib/zif/ui/label.rb#L55 and the initialize method had a ton of arguments that I initially didn't pass to super
Easy work around, but took some time to figure out why the font wasn't getting rendered right.
Metadata
Metadata
Assignees
Labels
No labels