Skip to content

Conversation

@dylanahsmith
Copy link
Contributor

@dylanahsmith dylanahsmith commented Mar 8, 2018

Ignore prepended modules when looking for already defined methods on a
class to set the visibility on.

@dylanahsmith dylanahsmith force-pushed the fix-set-wrapped-method-visibility branch from 4dcfce1 to 76a4a66 Compare March 8, 2018 20:13
private :wrapped
end

klass.new.wrapped.should == 2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously this failed with

NoMethodError: super: no superclass method `wrapped' for #<#<Class:0x00007fa541046210>:0x00007fa5410460f8>

because it was adding a method that called super which is meant for the case where an ancestor defines the method rather than when it is defined in a prepended module.

@dylanahsmith dylanahsmith force-pushed the fix-set-wrapped-method-visibility branch from 76a4a66 to 31956b3 Compare March 8, 2018 20:24
Ignore prepended modules when looking for already defined methods on a
class to set the visibility on.
@dylanahsmith dylanahsmith force-pushed the fix-set-wrapped-method-visibility branch from 31956b3 to b92a89a Compare March 8, 2018 20:58
@matzbot matzbot closed this in ae36cf6 Mar 12, 2018
matzbot pushed a commit that referenced this pull request Mar 20, 2018
	Fix setting method visibility on method wrapped with prepend

	Ignore prepended modules when looking for already defined methods on a
	class to set the visibility on.
	[Fix GH-1834]

	From: Dylan Thacker-Smith <Dylan.Smith@shopify.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
matzbot pushed a commit that referenced this pull request Mar 25, 2018
	Fix setting method visibility on method wrapped with prepend

	Ignore prepended modules when looking for already defined methods on a
	class to set the visibility on.
	[Fix GH-1834]

	From: Dylan Thacker-Smith <Dylan.Smith@shopify.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
matzbot pushed a commit that referenced this pull request Mar 28, 2018
	Fix setting method visibility on method wrapped with prepend

	Ignore prepended modules when looking for already defined methods on a
	class to set the visibility on.
	[Fix GH-1834]

	From: Dylan Thacker-Smith <Dylan.Smith@shopify.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
@dylanahsmith dylanahsmith deleted the fix-set-wrapped-method-visibility branch October 21, 2019 13:35
@hsbt hsbt added the Backport label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants