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 be able to use backticks instead of underscore for "type" args #124

Open
wagenet opened this issue Dec 15, 2021 · 2 comments
Open
Labels
bug Something isn't working

Comments

@wagenet
Copy link

wagenet commented Dec 15, 2021

RBS generation: 'type' is a keyword in RBS, renaming method parameter to '_type'

I believe that instead of renaming to _type you can wrap it in backticks.

@wagenet wagenet added the bug Something isn't working label Dec 15, 2021
@AaronC81
Copy link
Owner

Ah, so you can - thanks!

Something I noticed while experimenting, though, is that I can't get any parse errors to trigger when methods contain keywords even without backticks:

$ cat test.rbs
───────┬────────────────────────────────────────────────────────
       │ File: test.rbs
───────┬────────────────────────────────────────────────────────
   1   │ class Foo
   2   │   def def: (void: String, class: Integer) -> void
   3   │ end 
───────┴────────────────────────────────────────────────────────

$ rbs -I . method Foo def
::Foo#def
  defined_in: ::Foo
  implementation: ::Foo
  accessibility: public
  types:
      (void: ::String, class: ::Integer) -> void

I wonder if the parser has been made more permissive since I added this keyword check?

@wagenet
Copy link
Author

wagenet commented Dec 17, 2021

That's possible. I noticed the backtick usage in typeprof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants