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

Defining a Class#new singelton method causes issues with inheritance #50

Closed
eliias opened this issue Oct 25, 2022 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request

Comments

@eliias
Copy link
Collaborator

eliias commented Oct 25, 2022

Some y-rb object constructors are defined by the Class#new method. This causes some troubles when using common inheritance patterns:

class MyAwareness < Y::Awareness
  # need to explicitly define new as the defined singelton method does not expect any arguments
  self.new(argument)
    
  end
end

Instead of declaring #new, we want o just create a regular #initializer method. But, if the new constructor takes an argument and the parent class constructor does not, we end up with an error.

@eliias eliias added the enhancement New feature or request label Oct 25, 2022
@eliias eliias self-assigned this Oct 25, 2022
@eliias
Copy link
Collaborator Author

eliias commented Jan 19, 2023

I revisited the project where I wanted to do that, and I decided that we don't need it at all.

@eliias eliias closed this as completed Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant