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

[WIP] Enhance interop of generics, roles, and classes, Raku or nqp #773

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Commits on May 24, 2022

  1. Add some failing role_typecheck_list tests, tweak successful old ones

    - No need for nqp::eqaddr directly in the old tests.
    - We need to test for specializations and classes' role_typecheck_list
      in addition to parametric roles. Surprise! We have more work to do
      here.
    Kaiepi committed May 24, 2022
    Configuration menu
    Copy the full SHA
    899d5b5 View commit details
    Browse the repository at this point in the history
  2. Fix role typechecking errors

    - Updating a role typecheck list should delegate to another role
      typecheck list at one point or another.
    - The role typecheck list should become part of the type cache for any
      given MRO-ish type.
    - The role typecheck list should carry a containerless `VMArray` of
      roles, as is the case with the MRO which, combined with the type
      object itself, forms the type cache of a supportive kind of type.
    - Because a concrete role's instance is optional as `RoleToClassApplier`
      depends on it, such a nullish value should not become part of the
      roles list.
    - Due to the simplicity of the various NQP HOWs' typechecks, each can
      carry a definitive type cache.
    - Curried roles need typechecking in order for Rakudo to build with each
      of these changes.
    Kaiepi committed May 24, 2022
    Configuration menu
    Copy the full SHA
    27cc1ad View commit details
    Browse the repository at this point in the history

Commits on May 26, 2022

  1. Unify the roles metamethods

    This is more or less a direct translation of Rakudo's `roles`
    metamethods as applied. Besides new parameters, the key difference is
    `NQPClassHOW.roles`' `:$local` parameter, which (thankfully) was
    required before. It should be capable of matching Rakudo's `0` default
    because of that.
    Kaiepi committed May 26, 2022
    Configuration menu
    Copy the full SHA
    533acf9 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2022

  1. Revert "Unify the roles metamethods"

    This is a recursive algorithm, echoing problems with coercions back in
    the day. There's a better approach to this.
    
    This reverts commit 533acf9.
    Kaiepi committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    3003290 View commit details
    Browse the repository at this point in the history
  2. Make nqp classes vaguely aware of ^mro(:concretizations|:roles)

    `Metamodel::C3MRO` now expects a `:concretizations` parameter, but we
    lack the `Metamodel::ConcreteRoleHOW` it wants from whatever carries it;
    `:roles` is based off this as well.
    Kaiepi committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    f77e64e View commit details
    Browse the repository at this point in the history
  3. Introduce the metamodel MonicMachine

    A backport of Rakudo's. We lack its efface method here since we lack
    `^parents(:excl)`.
    Kaiepi committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    319b6af View commit details
    Browse the repository at this point in the history
  4. Compute C3MRO via monic beckoning, not c3_merge

    Backport of Rakudo's changes. Err against recursing by depending on the
    MROs of parents instead.
    Kaiepi committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    e5270b5 View commit details
    Browse the repository at this point in the history
  5. Fix NQPClassHOW's role typecheck list fix

    Include the specialization, not a duplicate of the role that was
    specialized.
    Kaiepi committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    6d8a65b View commit details
    Browse the repository at this point in the history
  6. Call NQPClassHOW's role typecheck list what it is

    For consistency with every other HOW.
    Kaiepi committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    842b5fc View commit details
    Browse the repository at this point in the history
  7. Unify the roles metamethods

    Backport of Rakudo's changes. `NQPConcreteRoleHOW` follows MRO ordering
    for consistency with `Metamodel::ConcreteRoleHOW`.
    Kaiepi committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    3a30678 View commit details
    Browse the repository at this point in the history
  8. Unify the parents metamethods

    Backport of Rakudo's changes. Nothing's hidden in nqp, so nothing to
    `:excl`.
    Kaiepi committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    f31c499 View commit details
    Browse the repository at this point in the history