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

Should escape if param name include not simple-word #1618

Merged
merged 2 commits into from Nov 21, 2023

Conversation

ksss
Copy link
Collaborator

@ksss ksss commented Nov 14, 2023

Fixes a syntax error in RBS output by rbs prototype runtime when names that cannot be used as variable names are used as members of Struct/Data, so that they are escaped.
The root cause of this problem is that parameter names are not escaped in Writer, or are missed even if escaped.

Real example:
https://github.com/rails/rails/blob/5b45a58cc8ad1809ee2732aa994fdb421a09cd94/activerecord/lib/active_record/relation/predicate_builder/range_handler.rb#L6

@ksss ksss changed the title [rbs prototype runtime] Should escape if argument name include not simple-word Should escape if argument name include not simple-word Nov 14, 2023
@ksss ksss changed the title Should escape if argument name include not simple-word Should escape if param name include not simple-word Nov 14, 2023
Copy link
Member

@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.

👍

@soutaro soutaro added this to the RBS 3.3.x milestone Nov 14, 2023
@soutaro soutaro added this pull request to the merge queue Nov 21, 2023
Merged via the queue into ruby:master with commit 391ea57 Nov 21, 2023
23 checks passed
@ksss ksss deleted the escape-args branch November 21, 2023 02:20
@soutaro soutaro added the Released PRs already included in the released version label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

None yet

2 participants