diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-12-20 10:21:37 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-12-20 10:34:54 +0900 |
| commit | d0f60182af9114f6840d993d74f492e483302805 (patch) | |
| tree | 1ec990607833219fc2ea735c64408b56b2e39ec3 /src/proc.c | |
| parent | d9049c10fa922e6978257eaf9fa777b4f844777d (diff) | |
| download | mruby-d0f60182af9114f6840d993d74f492e483302805.tar.gz mruby-d0f60182af9114f6840d993d74f492e483302805.zip | |
The superclass info should be taken from `TARGET_CLASS(ci->proc).
Not from `ci->target_class` that may be switched using `class_eval` etc.
fix #3899, fix #3906
We found out there is a mruby specific limitation that `super` may be
screwed up when a method is defined in a module and `super` is called
in the block with the target class switched (for example, `super` in
`class_eval` block). Now we raise `RuntimeError` for such cases.
The following code works in CRuby but not in mruby.
```
module M
def foo
"aaa".singleton_class.class_eval{super 2}
end
end
class Foo
def foo(*); end
end
class Bar<Foo
include M
end
Bar.new.foo
```
Diffstat (limited to 'src/proc.c')
0 files changed, 0 insertions, 0 deletions
