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

Fix super and zsuper with block #568

Merged
merged 2 commits into from
Jun 10, 2022
Merged

Fix super and zsuper with block #568

merged 2 commits into from
Jun 10, 2022

Conversation

kachick
Copy link
Contributor

@kachick kachick commented Jun 5, 2022

Currently empty arguments passing to super makes UnexpectedError as below. So I needed to avoid the syntax as kachick/ruby-ulid#189 (comment)

UnexpectedError: undefined method `selector' for #<Parser::Source::Map::Keyword:0x00007f53d402d878 @keyword=#<Parser::Source::Range lib/ulid/monotonic_generator.rb 269...274>, @end=#<Parser::Source::Range lib/ulid/monotonic_generator.rb 275...276>, @begin=#<Parser::Source::Range lib/ulid/monotonic_generator.rb 274...275>, @expression=#<Parser::Source::Range lib/ulid/monotonic_generator.rb 269...276>, @node=s(:super)>

          super(node: node, location: node.loc.selector)
                                              ^^^^^^^^^(Ruby::UnexpectedError)

When digging "super and zsuper with block", I found #512. So this PR tries to care the issue too.

Fixes #512

Copy link
Owner

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks! 🙏

@soutaro soutaro merged commit 271d3f3 into soutaro:master Jun 10, 2022
@kachick
Copy link
Contributor Author

kachick commented Jun 10, 2022

Thank you for review and merge! 🙏

@kachick kachick deleted the fix-super-with-block branch June 10, 2022 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected error when super with block
2 participants