-
Notifications
You must be signed in to change notification settings - Fork 171
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
Add Integer#to_d #649
Add Integer#to_d #649
Conversation
Codecov Report
@@ Coverage Diff @@
## master #649 +/- ##
==========================================
+ Coverage 82.91% 82.92% +0.01%
==========================================
Files 56 56
Lines 7486 7492 +6
==========================================
+ Hits 6207 6213 +6
Misses 1026 1026
Partials 253 253
Continue to review full report at Codecov.
|
vm/integer.go
Outdated
Name: "to_d", | ||
Fn: func(receiver Object, sourceLine int) builtinMethodBody { | ||
return func(t *thread, args []Object, blockFrame *normalCallFrame) Object { | ||
r := receiver.(*IntegerObject) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add argument check here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do that.
I also found that arg checks are missing in other methods so I'd add them in another PR.
vm/integer.go
Outdated
Name: "to_d", | ||
Fn: func(receiver Object, sourceLine int) builtinMethodBody { | ||
return func(t *thread, args []Object, blockFrame *normalCallFrame) Object { | ||
if len(args) > 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does it receive one argument? I don't see we use any here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should've mentioned about #648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think either you also implement the feature that requires the argument, or you set the limit to 0 until you're going to implement that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see!
Remove temporal comments
Fixes #647