Bug in 1.8.7-p249, the version shipped with Ubuntu 10.04

I

Intransition

I recently upgraded from 1.8.7-p72 to 1.8.7-p249 and a piece of code
that I had long relied on stopped working. Here is an example of the
issue:

class X
def q; "q"; end
end

class Y < X
def q
f do
super()
end
end
def f(&b)
b.call
end
end

y = Y.new
y.q

NoMethodError: super called outside of method
from (irb):7
from (irb):11:in `call'
from (irb):11:in `f'
from (irb):6:in `q'
from (irb):15

I tried this on 1.9.2 and it works so I am assuming this is a bug with
p249?
 
U

Urabe Shyouhei

Hello,

NoMethodError: super called outside of method
from (irb):7
from (irb):11:in `call'
from (irb):11:in `f'
from (irb):6:in `q'
from (irb):15

I tried this on 1.9.2 and it works so I am assuming this is a bug with
p249?

Yes and fixed already. Try a newer patchlevel.
 
L

Lucas Nussbaum

I recently upgraded from 1.8.7-p72 to 1.8.7-p249 and a piece of code
that I had long relied on stopped working. Here is an example of the
issue:

class X
def q; "q"; end
end

class Y < X
def q
f do
super()
end
end
def f(&b)
b.call
end
end

y = Y.new
y.q

NoMethodError: super called outside of method
from (irb):7
from (irb):11:in `call'
from (irb):11:in `f'
from (irb):6:in `q'
from (irb):15

I tried this on 1.9.2 and it works so I am assuming this is a bug with
p249?

Would you mind reporting this as a bug on
https://bugs.launchpad.net/ubuntu/+source/ruby1.8 ?

I'll try to take it from there.

- Lucas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top