Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Mirror.subject= assignments. #3344

Closed

Conversation

thedarkone
Copy link
Contributor

This fixes a common Ruby gotcha.

Besides Mirror.subject is not used anywhere, should we remove it?

PS: additionally, would a patch like this get accepted?

--- a/kernel/bootstrap/mirror.rb
+++ b/kernel/bootstrap/mirror.rb
@@ -1,11 +1,7 @@
 module Rubinius
   class Mirror
-    def self.subject=(klass)
-      @subject = klass
-    end
-
-    def self.subject
-      @subject
+    class << self
+      attr_accessor :subject
     end

     def self.reflect(obj)

@yorickpeterse
Copy link
Contributor

I can't seem to find any references to subject in both the kernel/ and vm/ directories. My guess is that this is a remnant of an earlier implementation, or it was intended to be used for something which hasn't been implemented (yet). Since I'm not 100% sure I'll let @brixen decide.

@yorickpeterse
Copy link
Contributor

Rebased into 798d13e. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants