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

Update documentation for overloading methods #658

Merged
merged 1 commit into from Apr 21, 2021
Merged

Update documentation for overloading methods #658

merged 1 commit into from Apr 21, 2021

Conversation

Adrian-Hirt
Copy link
Contributor

From ruby/gem_rbs_collection#16:

I did not find the ... triple dot syntax for overloading methods, e.g. when defining a method multiple times.

I added the DuplicatedMethodDefinitionError to the docs/sigs.md, such that users that encounter that error have some pointers on what to do.

I also added the ... syntax to the _method-types_ in docs/syntax.md, but I'm not sure if that is 100% the correct place.
In some places, the triple-dot (ellipsis) is used as a placeholder for "other may follow", which can be a bit confusing, and as such, I replaced it by etc..
However, at two places, I was not entirely sure if the ... is a mere placeholder, or functions as the overloading operator:

  1. In the Members section, for the _method-name_:
_method-name_ ::= ...
                | /`[^`]+`/
  1. In the Declarations section, for the _global-name_:
_global-name_ ::= /$[a-zA-Z]\w+/ | ...

I'd appreciate it if someone could give some feedback, what function the ... has at that place, I can then gladly add another commit to make it more clear.

Regards, and thank you all for your work

Adrian

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.

Thanks!

@soutaro soutaro merged commit f928d0f into ruby:master Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants