Skip to content

Commit

Permalink
Fix methods being mistakenly called routines
Browse files Browse the repository at this point in the history
Resolves #484.

@subkinds is an array like:

    [Array[Str].new("method"), Array[Str].new("method")]

The code checks if there's more than one element and falls back to
relatively safe “routine” word. However, in this case there are
multiple items and all of them are methods, so let's squish the whole
thing before performing the check (using yet undocumented “with”
parameter, see #1490).

There were many methods affected by this.
  • Loading branch information
AlexDaniel committed Sep 2, 2017
1 parent 1b66b66 commit a837f18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion htmlify.p6
Expand Up @@ -918,7 +918,9 @@ sub write-kind($kind) {
.categorize({.name})
.kv.map: -> $name, @docs {
my @subkinds = @docs.map({.subkinds}).unique;
my $subkind = @subkinds.elems == 1 ?? @subkinds.list[0] !! $kind;
my $subkind = @subkinds.squish(with => &infix:<~~>) == 1
?? @subkinds.list[0]
!! $kind;
my $pod = pod-with-title(
"Documentation for $subkind $name",
pod-block("Documentation for $subkind $name, assembled from the following types:"),
Expand Down

0 comments on commit a837f18

Please sign in to comment.