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

rbs prototype rb vs. class << self #510

Closed
palkan opened this issue Dec 6, 2020 · 1 comment
Closed

rbs prototype rb vs. class << self #510

palkan opened this issue Dec 6, 2020 · 1 comment

Comments

@palkan
Copy link
Contributor

palkan commented Dec 6, 2020

Example code:

# a.rb
class A
  class << self
    attr_reader :foo

    def bar
      "baz"
    end
  end
end

Generated signature:

$ rbs -v
rbs 0.19.0

$ rbs prototype rb a.rb

class A
  attr_reader foo: untyped

  def self.bar: () -> "baz"
end

The signature declares attr_reader for the class instances, not the singleton.

(Also, we currently don't support self attr_reader/writer, right? Or am I missing something)

@soutaro
Copy link
Member

soutaro commented Dec 7, 2020

I think the improvements in the latest version 0.20.1 would help. (#502 and #505)

@soutaro soutaro closed this as completed Dec 11, 2020
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

2 participants