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 annotation in CodeObjects::Base#files #1178

Merged
merged 2 commits into from Aug 11, 2018

Conversation

gmalette
Copy link
Contributor

The original annotation incorrectly was Array but the format is

[ [file, line] ]

Therefore the annotation should be Array<Array<String, Integer>>,
given there is no prescribed way to describe tuples

Description

Describe your pull request and problem statement here.

Completed Tasks

  • I have read the Contributing Guide.
  • The pull request is complete (implemented / written).
  • Git commits have been cleaned up (squash WIP / revert commits).
  • I wrote tests and ran bundle exec rake locally (if code is attached to PR).

The original annotation incorrectly was Array<String> but the format is

```
[ [file, line] ]
```

Therefore the annotation should be `Array<Array<String, Integer>>`,
given there is no prescribed way to describe tuples
@coveralls
Copy link

coveralls commented Jul 20, 2018

Coverage Status

Coverage increased (+0.03%) to 93.633% when pulling 465e1f9 on gmalette:gm/fix-annotation-of-files into 8a0e6ac on lsegal:master.

@@ -132,7 +132,7 @@ def push(value)
# @see NamespaceMapper.register_separator
class Base
# The files the object was defined in. To add a file, use {#add_file}.
# @return [Array<String>] a list of files
# @return [Array<Array<String, Integer>>] a list of files
Copy link
Owner

Choose a reason for hiding this comment

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

You can use Array<Array(String, Integer)> to denote ordered tuples. Try it out at https://yardoc.org/types.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TIL! Thanks, fixed 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given X<A, B> means X parameterized by either A or B, how do you annotate X parameterized by both A and B ?

@lsegal lsegal merged commit e46506a into lsegal:master Aug 11, 2018
@lsegal
Copy link
Owner

lsegal commented Aug 11, 2018

Thanks!

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.

None yet

3 participants