[ruby-trunk - Bug #9236][Open] include + include + alias_method + super behaviour inconsistency betw

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


Bug #9236: include + include + alias_method + super behaviour
inconsistency between 1.9 and 2.0

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

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

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

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

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>)).
=end

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

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>)).
=end

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

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>)).
=end

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

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>)).
=end

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

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>)).
=end

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

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>)).
=end