Fix class Class < superclass for invalid superclass - #2123
Merged
Merged
Conversation
davispuh
force-pushed
the
class
branch
3 times, most recently
from
October 8, 2020 23:36
9149002 to
d86529c
Compare
elia
previously approved these changes
Dec 12, 2020
elia
left a comment
Member
There was a problem hiding this comment.
Just a question about the test case, otherwise looks good! 👍
Comment on lines
+135
to
+136
| -> { class TestClass < `#{Module.new}`; end }.should raise_error(TypeError, error_msg) | ||
| -> { class TestClass < `#{BasicObject.new}`; end }.should raise_error(TypeError, error_msg) |
Member
There was a problem hiding this comment.
Maybe I'm missing something… isn't this the same as
-> { class TestClass < Module.new; end }.should raise_error(TypeError, error_msg)
-> { class TestClass < BasicObject.new; end }.should raise_error(TypeError, error_msg)
Contributor
Author
There was a problem hiding this comment.
There isn't any reason for it, did based on similarity from others and thought maybe it does make some difference. Anyway removed it. Updated PR with your changes aswell.
elia
force-pushed
the
class
branch
3 times, most recently
from
December 12, 2020 16:11
0c56663 to
2f3dfc8
Compare
Member
|
@davispuh I amended the commit to get rid of the linting issue |
elia
dismissed
their stale review
December 12, 2020 22:03
I hit approve because it's basically 👍 but I'll approve again once I understand why we need the interpolation
elia
approved these changes
Jul 16, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While trying to do #2114 I found this bug that
This fails with
Uncaught TypeError: can't convert undefined to objectbut it should raise errorTypeError: superclass must be a Class (BasicObject given)like Ruby does.Note that
Class.new(BasicObject.new)works correctly.In Ruby specs there is test for
Class.newbut not forclass Class < superclassso they were passing, but I added such test aswell ruby/spec#792