Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubymethod lookup and ancestorsSingle-choice MCQ

`um.bind(R.new)` raises `TypeError` below. What rule about `UnboundMethod#bind` does this enforce?

class P; def m; "P#m"; end; end class R; end um = P.instance_method(:m) um.bind(P.new).call # => "P#m" um.bind(R.new) # => TypeError