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

_parameter_ typo fix #369

Merged
merged 1 commit into from
Aug 19, 2020
Merged

_parameter_ typo fix #369

merged 1 commit into from
Aug 19, 2020

Conversation

sbeckeriv
Copy link
Contributor

Dearest Reviewer,

This is a a typo fix. While I am here I have a question about parameter. Why would a parameter include a var-name if it was not in the name parameter format (x: Int)?

  def bar: (untyped `type`, void: untyped `void`) -> untyped

In this test what does type do? https://github.com/ruby/rbs/blob/master/test/rbs/signature_parsing_test.rb#L786

I am mostly reading the syntax document. Is there another document I should be reading for reference?

Thanks for your time,

Dictated but not reviewed,
Becker

Dearest Reviewer,

This is a a typo fix.  While I am here I have a question about _parameter_. Why would a parameter include a var-name if it was not in the name parameter format `(x: Int)`? 

```
  def bar: (untyped `type`, void: untyped `void`) -> untyped
```
In this test what does `type` do? https://github.com/ruby/rbs/blob/master/test/rbs/signature_parsing_test.rb#L786

I am mostly reading the syntax document. Is there another document I should be reading for reference? 

Thanks for your time,

Dictated but not reviewed,
Becker
@soutaro soutaro merged commit 866f8f9 into ruby:master Aug 19, 2020
@soutaro
Copy link
Member

soutaro commented Aug 19, 2020

Thank you @sbeckeriv !

def foo: (String name, email: String address) -> void

Let's think about the example above. The name is the name of parameter and email is the name of keyword. I think your question is about address. It's just because I reuse the syntax rule for parameter in keyword type too.

I agree that there is much of usage for the name in keyword arguments, but causing some confusion... Just removing it might make more sense.

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