[ruby-dev:49318] [Ruby trunk - Bug #11635] [Rejected] super in instance_eval in a method defined in a module is invoked with a wrong receiver
From:
shugo@...
Date:
2015-10-30 02:12:26 UTC
List:
ruby-dev #49318
Issue #11635 has been updated by Shugo Maeda.
Status changed from Assigned to Rejected
----------------------------------------
Bug #11635: super in instance_eval in a method defined in a module is invoked with a wrong receiver
https://bugs.ruby-lang.org/issues/11635#change-54646
* Author: Shugo Maeda
* Status: Rejected
* Priority: Normal
* Assignee: Koichi Sasada
* ruby -v:
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
super in instance_eval in a method defined in a module is invoked with a wrong receiver:
```
class Foo
def initialize
@foo = :foo
end
def foo
p [self, @foo]
end
end
module M
def foo
x = Object.new
x.instance_eval do
super
end
end
end
class Bar < Foo
include M
end
Bar.new.foo
```
The output should be `[#<Foo:...>, :foo]` or an exception.
Matz prefer the former (https://twitter.com/yukihiro_matz/status/659913844861464576).
--
https://bugs.ruby-lang.org/