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

Methods defined in a Struct.new block end up on parent module #84

Open
wagenet opened this issue Dec 13, 2021 · 0 comments
Open

Methods defined in a Struct.new block end up on parent module #84

wagenet opened this issue Dec 13, 2021 · 0 comments

Comments

@wagenet
Copy link
Contributor

wagenet commented Dec 13, 2021

Customer = Struct.new(:name, :address) do
  def greeting
    "Hello #{name}!"
  end
end

Generated:

class Object
  private
  def greeting: -> String
end

class Customer < Struct[untyped]
  attr_accessor name(): untyped
  attr_accessor address(): untyped
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant