# \[ruby-trunk - Bug #9236\]\[Open\] include + include + alias\_method + super behaviour inconsistency betw

**URL:** <https://www.ruby-forum.com/t/ruby-trunk-bug-9236-open-include-include-alias-method-super-behaviour-inconsistency-betw/237989>\
**Category:** Development\
**Created:** [December 10, 2013, 4:19pm UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-9236-open-include-include-alias-method-super-behaviour-inconsistency-betw/237989 "2013-12-10T16:19:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [December 10, 2013, 4:19pm UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-9236-open-include-include-alias-method-super-behaviour-inconsistency-betw/237989/1 "2013-12-10T16:19:52Z")

</div>

Issue #9236 has been reported by matsuda (Akira M.).

* * *

Bug #9236: include + include + alias\_method + super behaviour  
inconsistency between 1.9 and 2.0

> **[Bug #9236: include + include + alias\_method + super behaviour inconsistency...](https://bugs.ruby-lang.org/issues/9236)**
>
> Redmine

Author: matsuda (Akira M.)  
Status: Open  
Priority: Normal  
Assignee: ko1 (Koichi Sasada)  
Category: core  
Target version:  
ruby -v: ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN

The following code behaves differently under Ruby 1 and Ruby 2.

(({  
module Fun  
def hello  
orig\_hello  
end  
end

module M1  
def hello  
p ‘hello!’  
end  
end

module M2  
def hello  
super  
end  
end

class Foo  
include M1  
include M2

alias\_method :orig\_hello, :hello  
include Fun  
end

Foo.new.hello  
}))

% ruby -v fun.rb  
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86\_64-darwin12.5.0]  
“hello!”

% ruby -v fun.rb  
ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
fun.rb:3: stack level too deep (SystemStackError)

Let’s see if this is an intended spec change or a bug.

# This issue was originally reported to Rails Core ML by Gary W…

[https://groups.google.com/forum/#!topic/rubyonrails-core/z5Japo3oIzk](https://groups.google.com/forum/#!topic/rubyonrails-core/z5Japo3oIzk)

---

<div class="post-metadata">

**Author:** ![matsuda\_SAkira\_M.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@matsuda\_SAkira\_M.S](https://www.ruby-forum.com/u/matsuda_SAkira_M.S)\
**Post date:** [December 10, 2013, 4:23pm UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-9236-open-include-include-alias-method-super-behaviour-inconsistency-betw/237989/2 "2013-12-10T16:23:23Z")

</div>

Issue #9236 has been updated by matsuda (Akira M.).

Description updated

=begin  
=end

* * *

Bug #9236: include + include + alias\_method + super behaviour  
inconsistency between 1.9 and 2.0

> **[Updated by matsuda (Akira Matsuda) almost 13 years ago ActionsCopy link 1... -...](https://bugs.ruby-lang.org/issues/9236#change-43578)**
>
> =begin =end | Redmine

Author: matsuda (Akira M.)  
Status: Open  
Priority: Normal  
Assignee: ko1 (Koichi Sasada)  
Category: core  
Target version:  
ruby -v: ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN

The following code behaves differently under Ruby 1 and Ruby 2.

module Fun  
def hello  
orig\_hello  
end  
end

module M1  
def hello  
p ‘hello!’  
end  
end

module M2  
def hello  
super  
end  
end

class Foo  
include M1  
include M2

alias\_method :orig\_hello, :hello  
include Fun  
end

Foo.new.hello

% ruby -v fun.rb  
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86\_64-darwin12.5.0]  
“hello!”

% ruby -v fun.rb  
ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
fun.rb:3: stack level too deep (SystemStackError)

Let’s see if this is an intended spec change or a bug.

# This issue was originally reported to Rails Core ML by Gary W..

> **[Redirecting to Google Groups](https://groups.google.com/forum/#!topic/rubyonrails-core/z5Japo3oIzk)**

---

<div class="post-metadata">

**Author:** ![matsuda\_SAkira\_M.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@matsuda\_SAkira\_M.S](https://www.ruby-forum.com/u/matsuda_SAkira_M.S)\
**Post date:** [December 10, 2013, 4:38pm UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-9236-open-include-include-alias-method-super-behaviour-inconsistency-betw/237989/3 "2013-12-10T16:38:35Z")

</div>

Issue #9236 has been updated by nobu (Nobuyoshi N.).

Description updated

* * *

Bug #9236: include + include + alias\_method + super behaviour  
inconsistency between 1.9 and 2.0

> **[Bug #9236: include + include + alias\_method + super behaviour inconsistency...](https://bugs.ruby-lang.org/issues/9236#change-43581)**
>
> Redmine

Author: matsuda (Akira M.)  
Status: Open  
Priority: Normal  
Assignee: ko1 (Koichi Sasada)  
Category: core  
Target version:  
ruby -v: ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN

=begin  
The following code behaves differently under Ruby 1 and Ruby 2.

module Fun  
def hello  
orig\_hello  
end  
end

module M1  
def hello  
p ‘hello!’  
end  
end

module M2  
def hello  
super  
end  
end

class Foo  
include M1  
include M2

```
alias_method :orig_hello, :hello
include Fun

```

end

Foo.new.hello

% ruby -v fun.rb  
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86\_64-darwin12.5.0]  
“hello!”

% ruby -v fun.rb  
ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
fun.rb:3: stack level too deep (SystemStackError)

Let’s see if this is an intended spec change or a bug.

((‘#’)) This issue was originally reported to ((\<Rails Core ML by Gary  
Weaver|URL:[Redirecting to Google Groups](https://groups.google.com/forum/#!topic/rubyonrails-core/z5Japo3oIzk)\>)).  
=end

---

<div class="post-metadata">

**Author:** ![matsuda\_SAkira\_M.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@matsuda\_SAkira\_M.S](https://www.ruby-forum.com/u/matsuda_SAkira_M.S)\
**Post date:** [December 11, 2013, 4:02am UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-9236-open-include-include-alias-method-super-behaviour-inconsistency-betw/237989/4 "2013-12-11T04:02:10Z")

</div>

Issue #9236 has been updated by matthewd (Matthew Draper).

## git bisect says this changed in r36595, if it helps.

Bug #9236: include + include + alias\_method + super behaviour  
inconsistency between 1.9 and 2.0

> **[Updated by matthewd (Matthew Draper) almost 13 years ago ActionsCopy link 3... -...](https://bugs.ruby-lang.org/issues/9236#change-43594)**
>
> =begin =end | Redmine

Author: matsuda (Akira M.)  
Status: Open  
Priority: Normal  
Assignee: ko1 (Koichi Sasada)  
Category: core  
Target version:  
ruby -v: ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN

=begin  
The following code behaves differently under Ruby 1 and Ruby 2.

module Fun  
def hello  
orig\_hello  
end  
end

module M1  
def hello  
p ‘hello!’  
end  
end

module M2  
def hello  
super  
end  
end

class Foo  
include M1  
include M2

```
alias_method :orig_hello, :hello
include Fun

```

end

Foo.new.hello

% ruby -v fun.rb  
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86\_64-darwin12.5.0]  
“hello!”

% ruby -v fun.rb  
ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
fun.rb:3: stack level too deep (SystemStackError)

Let’s see if this is an intended spec change or a bug.

((‘#’)) This issue was originally reported to ((\<Rails Core ML by Gary  
Weaver|URL:[Redirecting to Google Groups](https://groups.google.com/forum/#!topic/rubyonrails-core/z5Japo3oIzk)\>)).  
=end

---

<div class="post-metadata">

**Author:** ![matsuda\_SAkira\_M.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@matsuda\_SAkira\_M.S](https://www.ruby-forum.com/u/matsuda_SAkira_M.S)\
**Post date:** [December 13, 2013, 3:54pm UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-9236-open-include-include-alias-method-super-behaviour-inconsistency-betw/237989/5 "2013-12-13T15:54:47Z")

</div>

Issue #9236 has been updated by nobu (Nobuyoshi N.).

% Done changed from 0 to 100

* * *

Bug #9236: include + include + alias\_method + super behaviour  
inconsistency between 1.9 and 2.0

> **[Bug #9236: include + include + alias\_method + super behaviour inconsistency...](https://bugs.ruby-lang.org/issues/9236#change-43644)**
>
> Redmine

Author: matsuda (Akira M.)  
Status: Closed  
Priority: Normal  
Assignee: ko1 (Koichi Sasada)  
Category: core  
Target version:  
ruby -v: ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN

=begin  
The following code behaves differently under Ruby 1 and Ruby 2.

module Fun  
def hello  
orig\_hello  
end  
end

module M1  
def hello  
p ‘hello!’  
end  
end

module M2  
def hello  
super  
end  
end

class Foo  
include M1  
include M2

```
alias_method :orig_hello, :hello
include Fun

```

end

Foo.new.hello

% ruby -v fun.rb  
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86\_64-darwin12.5.0]  
“hello!”

% ruby -v fun.rb  
ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
fun.rb:3: stack level too deep (SystemStackError)

Let’s see if this is an intended spec change or a bug.

((‘#’)) This issue was originally reported to ((\<Rails Core ML by Gary  
Weaver|URL:[Redirecting to Google Groups](https://groups.google.com/forum/#!topic/rubyonrails-core/z5Japo3oIzk)\>)).  
=end

---

<div class="post-metadata">

**Author:** ![matsuda\_SAkira\_M.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@matsuda\_SAkira\_M.S](https://www.ruby-forum.com/u/matsuda_SAkira_M.S)\
**Post date:** [December 14, 2013, 2:15am UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-9236-open-include-include-alias-method-super-behaviour-inconsistency-betw/237989/6 "2013-12-14T02:15:12Z")

</div>

Issue #9236 has been updated by matsuda (Akira M.).

## Confirmed the fix. Thanks!

Bug #9236: include + include + alias\_method + super behaviour  
inconsistency between 1.9 and 2.0

> **[Updated by matsuda (Akira Matsuda) almost 13 years ago ActionsCopy link 6... -...](https://bugs.ruby-lang.org/issues/9236#change-43657)**
>
> =begin =end | Redmine

Author: matsuda (Akira M.)  
Status: Closed  
Priority: Normal  
Assignee: ko1 (Koichi Sasada)  
Category: core  
Target version:  
ruby -v: ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN

=begin  
The following code behaves differently under Ruby 1 and Ruby 2.

module Fun  
def hello  
orig\_hello  
end  
end

module M1  
def hello  
p ‘hello!’  
end  
end

module M2  
def hello  
super  
end  
end

class Foo  
include M1  
include M2

```
alias_method :orig_hello, :hello
include Fun

```

end

Foo.new.hello

% ruby -v fun.rb  
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86\_64-darwin12.5.0]  
“hello!”

% ruby -v fun.rb  
ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
fun.rb:3: stack level too deep (SystemStackError)

Let’s see if this is an intended spec change or a bug.

((‘#’)) This issue was originally reported to ((\<Rails Core ML by Gary  
Weaver|URL:[Redirecting to Google Groups](https://groups.google.com/forum/#!topic/rubyonrails-core/z5Japo3oIzk)\>)).  
=end

---

<div class="post-metadata">

**Author:** ![matsuda\_SAkira\_M.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@matsuda\_SAkira\_M.S](https://www.ruby-forum.com/u/matsuda_SAkira_M.S)\
**Post date:** [December 18, 2013, 4:50am UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-9236-open-include-include-alias-method-super-behaviour-inconsistency-betw/237989/7 "2013-12-18T04:50:42Z")

</div>

Issue #9236 has been updated by nobu (Nobuyoshi N.).

Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: DONTNEED,  
2.0.0: REQUIRED

* * *

Bug #9236: include + include + alias\_method + super behaviour  
inconsistency between 1.9 and 2.0

> **[Bug #9236: include + include + alias\_method + super behaviour inconsistency...](https://bugs.ruby-lang.org/issues/9236#change-43735)**
>
> Redmine

Author: matsuda (Akira M.)  
Status: Closed  
Priority: Normal  
Assignee: ko1 (Koichi Sasada)  
Category: core  
Target version:  
ruby -v: ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
Backport: 1.9.3: DONTNEED, 2.0.0: REQUIRED

=begin  
The following code behaves differently under Ruby 1 and Ruby 2.

module Fun  
def hello  
orig\_hello  
end  
end

module M1  
def hello  
p ‘hello!’  
end  
end

module M2  
def hello  
super  
end  
end

class Foo  
include M1  
include M2

```
alias_method :orig_hello, :hello
include Fun

```

end

Foo.new.hello

% ruby -v fun.rb  
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86\_64-darwin12.5.0]  
“hello!”

% ruby -v fun.rb  
ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
fun.rb:3: stack level too deep (SystemStackError)

Let’s see if this is an intended spec change or a bug.

((‘#’)) This issue was originally reported to ((\<Rails Core ML by Gary  
Weaver|URL:[Redirecting to Google Groups](https://groups.google.com/forum/#!topic/rubyonrails-core/z5Japo3oIzk)\>)).  
=end

---

<div class="post-metadata">

**Author:** ![matsuda\_SAkira\_M.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@matsuda\_SAkira\_M.S](https://www.ruby-forum.com/u/matsuda_SAkira_M.S)\
**Post date:** [December 23, 2013, 2:59pm UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-9236-open-include-include-alias-method-super-behaviour-inconsistency-betw/237989/8 "2013-12-23T14:59:08Z")

</div>

Issue #9236 has been updated by nagachika (Tomoyuki C.).

Backport changed from 1.9.3: DONTNEED, 2.0.0: REQUIRED to 1.9.3:  
DONTNEED, 2.0.0: DONE

## r44175 and r44179 were backported to ruby\_2\_0\_0 at r44345, and additionally r44198 was backported at 44366.

Bug #9236: include + include + alias\_method + super behaviour  
inconsistency between 1.9 and 2.0

> **[ruby\_2\_0\_0 - Bug #9236: include + include + alias\_method + super behaviour...](https://bugs.ruby-lang.org/issues/9236#change-43854)**
>
> =begin =end | Redmine

Author: matsuda (Akira M.)  
Status: Closed  
Priority: Normal  
Assignee: ko1 (Koichi Sasada)  
Category: core  
Target version:  
ruby -v: ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
Backport: 1.9.3: DONTNEED, 2.0.0: DONE

=begin  
The following code behaves differently under Ruby 1 and Ruby 2.

module Fun  
def hello  
orig\_hello  
end  
end

module M1  
def hello  
p ‘hello!’  
end  
end

module M2  
def hello  
super  
end  
end

class Foo  
include M1  
include M2

```
alias_method :orig_hello, :hello
include Fun

```

end

Foo.new.hello

% ruby -v fun.rb  
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86\_64-darwin12.5.0]  
“hello!”

% ruby -v fun.rb  
ruby 2.1.0dev (2013-12-10 trunk 44126) [x86\_64-darwin12.0]  
fun.rb:3: stack level too deep (SystemStackError)

Let’s see if this is an intended spec change or a bug.

((‘#’)) This issue was originally reported to ((\<Rails Core ML by Gary  
Weaver|URL:[Redirecting to Google Groups](https://groups.google.com/forum/#!topic/rubyonrails-core/z5Japo3oIzk)\>)).  
=end
