The documentation for order-dependent lists (a.k.a tuples), is misleading, as it says to use Array<(String, Fixnum, Hash)>, when that is a mixed of long and short syntax, which is interpreted differently.
::YARD::DocstringParser.new.parse("@param [Array<(Date, Integer)>]").tags.first.explain_types
=> "an Array of (an Array containing (a Date followed by an Integer))"
Expected Output
# Long syntax
::YARD::DocstringParser.new.parse("@param [Array(Date, Integer)]").tags.first.explain_types
=> "an Array containing (a Date followed by an Integer)"
# Short syntax
::YARD::DocstringParser.new.parse("@param [(Date, Integer)]").tags.first.explain_types
=> "an Array containing (a Date followed by an Integer)"
Environment details:
OS: Ubuntu 23.10
Ruby version (ruby -v): ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]
The documentation for order-dependent lists (a.k.a tuples), is misleading, as it says to use
Array<(String, Fixnum, Hash)>
, when that is a mixed of long and short syntax, which is interpreted differently.https://github.com/lsegal/yard/blob/2d197a381c5d4cc5c55b2c60fff992b31c986361/docs/Tags.md?plain=1#L206-L209
Steps to reproduce
Use the
explain_types
on a param tagActual Output
Expected Output
Environment details:
ruby -v
): ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]yard -v
): yard 0.9.34I have read the Contributing Guide.