Skip to content

Ensure making a class abstract doesn't change the visibility of its .new #8

Description

@amomchilov

The implementation in #3 will always make new public, regardless of the visibility it had previously.

Desired behaviour:

class PrivateNew
  private_class_method :new
end

class MyAbstractClass < PrivateNew
  abstract!
end

p MyAbstractClass.singleton_class.public_method_defined?(:new)
# is true, should be false

class MySubclass < MyAbstractClass; end

p MySubclass.singleton_class.public_method_defined?(:new)
# is true, should be false

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions