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

Make .WHY on role group delegate to default role #3549

Merged
merged 3 commits into from
Jan 6, 2022
Merged

Commits on Jan 5, 2022

  1. Make .WHY on role group delegate to default role

    Roles have a two-level structure: the role name is a parametric role
    group, which in turns contains the parametric role. In the case of there
    being many roles of the same short name, they are within the one group.
    Declarator docs correctly attach to the parametric role. However, that
    means .WHY on the group doesn't actually result in those docs. You have
    to extract the candidate from the group.
    
    In many cases, however, we people ain't using parametric roles, and we
    make many meta-operations delegate to the single or unsignatured role
    candidate, if any. We do not currently do this for .WHY. This commit
    makes us do so, BUT it turns out there are 3 current spectests that will
    fail because they explicitly expect that not to happen. Thus, we need to
    make a decision over whether we want this change.
    
    Relates to #3521.
    jnthn authored and vrurg committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    91e3c98 View commit details
    Browse the repository at this point in the history

Commits on Jan 6, 2022

  1. Finalize delegation of .WHY on role group

    - Remove `Perl6::Metamodel::Documenting` from consumed roles
    - Fully implement `WHY`, `set_why`
    - Make `set_why` throw `X::Role::Group::Documenting` as a safety measure
    
    I deliberately don't delegate `set_why` in order to avoid accidental
    overriding of parametric role documentation. It doesn't and must not
    happen in Rakudo implementation anyway.
    vrurg committed Jan 6, 2022
    Configuration menu
    Copy the full SHA
    d3e7442 View commit details
    Browse the repository at this point in the history
  2. Make $*PRECEDING_DECL lexically scoped for signature

    Because signature is a local scope from documentation point of view.
    
    Fixes documenting of parametric role:
    
        role R[::T] {
            #= this now belongs to the role, not to the parameter T
        }
    
    And makes one spec TODO passing.
    vrurg committed Jan 6, 2022
    Configuration menu
    Copy the full SHA
    8f989d1 View commit details
    Browse the repository at this point in the history