# Super w/ implicit arguments in Ruby 1.9

**URL:** <https://www.ruby-forum.com/t/super-w-implicit-arguments-in-ruby-1-9/178433>\
**Category:** Ruby\
**Created:** [November 4, 2009, 4:39pm UTC](https://www.ruby-forum.com/t/super-w-implicit-arguments-in-ruby-1-9/178433 "2009-11-04T16:39:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [November 4, 2009, 4:39pm UTC](https://www.ruby-forum.com/t/super-w-implicit-arguments-in-ruby-1-9/178433/1 "2009-11-04T16:39:48Z")

</div>

Hi–

Debugging a library for 1.9.1 compatibility. I get this error:

1. Error:  
test\_02\_002(TC\_Inheritor\_02):  
RuntimeError: implicit argument passing of super from method defined  
by define\_method() is not supported. Specify all arguments  
explicitly.

The offending code is:

```
  define_method( key ) do
    defined?(super) ? super. __send__ (op,obj) : obj.dup
  end

```

So I’m confused since I am not calling super without arguments, though  
I am asking if it is defined. But #defined? works in a special way so  
as not to actually invoke it’s argument, right? Or is it something to  
with **send**? What is amiss here?

Thanks.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [November 4, 2009, 5:13pm UTC](https://www.ruby-forum.com/t/super-w-implicit-arguments-in-ruby-1-9/178433/2 "2009-11-04T17:13:47Z")

</div>

On Nov 4, 2009, at 10:39 AM, Intransition wrote:

> The offending code is:  
> Thanks.

read the line like the parser will:

defined?(super) ? (super). **send** ((op),(obj)) : (obj).dup

the object that gets **send** is the return value of super. Can you  
try:  
defined?(super) ? super(). **send** (op,obj) : obj.dup  
so that the implicit args of super aren’t an issue? (because you  
explicitly give an empty arg list)

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [November 4, 2009, 6:05pm UTC](https://www.ruby-forum.com/t/super-w-implicit-arguments-in-ruby-1-9/178433/3 "2009-11-04T18:05:17Z")

</div>

On Nov 4, 11:13 am, Rob B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> read the line like the parser will:
> 
> defined?(super) ? (super). **send** ((op),(obj)) : (obj).dup
> 
> the object that gets **send** is the return value of super. Can you  
> try:  
> defined?(super) ? super(). **send** (op,obj) : obj.dup  
> so that the implicit args of super aren’t an issue? (because you  
> explicitly give an empty arg list)

Doh. I should have seen that. Thank you for helping my poor little  
overtaxed brain 😉

Unfortunately now I get:

1. Error:  
test\_02\_002(TC\_Inheritor\_02):  
NoMethodError: super: no superclass method `koko' for TC_Inheritor_02::C:Class /mnt/repos/rubyworks/facets/lib/more/facets/inheritor.rb:70:in `block (2 levels) in inheritor’  
/mnt/repos/rubyworks/facets/test/more/test\_inheritor.rb:31:in  
`test\_02\_002’

Does defined?(super) not work in 1.9? If so, how does one work around?

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [November 4, 2009, 10:21pm UTC](https://www.ruby-forum.com/t/super-w-implicit-arguments-in-ruby-1-9/178433/4 "2009-11-04T22:21:39Z")

</div>

On Nov 4, 12:04 pm, Intransition [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > so that the implicit args of super aren’t an issue? (because you  
> > TC\_Inheritor\_02::C:Class  
> > /mnt/repos/rubyworks/facets/lib/more/facets/inheritor.rb:70:in  
> > `block (2 levels) in inheritor' /mnt/repos/rubyworks/facets/test/more/test_inheritor.rb:31:in `test\_02\_002’
> 
> Does defined?(super) not work in 1.9? If so, how does one work around?

No, it works. I checked. So it’s something else.

Thanks for the help.
