-
Notifications
You must be signed in to change notification settings - Fork 132
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
Kaiepi
wants to merge
11
commits into
Raku:main
Choose a base branch
from
Kaiepi:generic-class-role
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
- 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.
- 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.
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.
This is a recursive algorithm, echoing problems with coercions back in the day. There's a better approach to this. This reverts commit 533acf9.
`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.
A backport of Rakudo's. We lack its efface method here since we lack `^parents(:excl)`.
Backport of Rakudo's changes. Err against recursing by depending on the MROs of parents instead.
Include the specialization, not a duplicate of the role that was specialized.
For consistency with every other HOW.
Backport of Rakudo's changes. `NQPConcreteRoleHOW` follows MRO ordering for consistency with `Metamodel::ConcreteRoleHOW`.
Backport of Rakudo's changes. Nothing's hidden in nqp, so nothing to `:excl`.
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.
See rakudo/rakudo#4478. Starts with bug fixes to my prior role typecheck list handling. I have not yet done anything about making nqp's metamodel more consistent with Rakudo's.