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

Update Integer#to_s signature and add test #67

Merged
merged 2 commits into from Nov 10, 2019

Conversation

hanachin
Copy link
Contributor

No description provided.

Some class can not define singleton class

```
  1) Error:
IntegerTest#test_to_s:
TypeError: can't define singleton
    /home/sei/src/github.com/ruby/ruby-signature/lib/ruby/signature/test/hook.rb:373:in `singleton_class'
    /home/sei/src/github.com/ruby/ruby-signature/lib/ruby/signature/test/hook.rb:373:in `call'
    /home/sei/src/github.com/ruby/ruby-signature/lib/ruby/signature/test/hook.rb:373:in `call'
    /home/sei/src/github.com/ruby/ruby-signature/lib/ruby/signature/test/hook.rb:223:in `block in delegation'
    test/stdlib/Integer_test.rb:6:in `test_to_s'
```
@hanachin hanachin marked this pull request as ready for review November 10, 2019 07:42
@@ -220,7 +220,13 @@ def delegation(name, method_types, method_name)
end

method = hook.call(self, METHOD, name)
prepended = hook.call(self, CLASS).ancestors.include?(hook.instance_module) || hook.call(self, SINGLETON_CLASS).ancestors.include?(hook.singleton_module)
klass = hook.call(self, CLASS)
singleton_klass = begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix! 🎉

@@ -427,8 +427,42 @@ class Integer < Numeric
#
#
# Also aliased as: [inspect](Integer.downloaded.ruby_doc#method-i-inspect)
def to_s: (?Integer base) -> String

def to_s: () -> String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣

@soutaro soutaro merged commit f51b86f into ruby:master Nov 10, 2019
@hanachin hanachin deleted the update_integer_to_s branch November 11, 2019 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants