Fix annotation in CodeObjects::Base#files#1178
Merged
Merged
Conversation
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
lsegal
reviewed
Jul 21, 2018
| 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 |
Owner
There was a problem hiding this comment.
You can use Array<Array(String, Integer)> to denote ordered tuples. Try it out at https://yardoc.org/types.html
Contributor
Author
There was a problem hiding this comment.
TIL! Thanks, fixed 😄
Contributor
Author
There was a problem hiding this comment.
Given X<A, B> means X parameterized by either A or B, how do you annotate X parameterized by both A and B ?
Owner
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The original annotation incorrectly was Array but the format is
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
bundle exec rakelocally (if code is attached to PR).