Skip to content

feat(ast_tools): add EnumDef::all_inherits method#23950

Merged
graphite-app[bot] merged 1 commit into
mainfrom
om/06-29-feat_ast_tools_add_enumdef_all_inherits_method
Jun 30, 2026
Merged

feat(ast_tools): add EnumDef::all_inherits method#23950
graphite-app[bot] merged 1 commit into
mainfrom
om/06-29-feat_ast_tools_add_enumdef_all_inherits_method

Conversation

@overlookmotel

@overlookmotel overlookmotel commented Jun 29, 2026

Copy link
Copy Markdown
Member

EnumDef::inherits_enums returns an iterator of enums that an enum directly inherits from.

Add a method EnumDef::all_inherits which yields all inherited enums, including that which are inherited from transitively.

e.g.:

  • AssignmentTarget inherits SimpleAssignmentTarget and AssignmentTargetPattern
  • SimpleAssignmentTarget inherits MemberExpression.

The 2 methods returns iterators yielding:

  • inherits_enums: SimpleAssignmentTarget, AssignmentTargetPattern
  • all_inherits: SimpleAssignmentTarget, MemberExpression, AssignmentTargetPattern

Use the new AllInheritsIter iterator to simplify the AllVariantsIter iterator.

overlookmotel commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@overlookmotel

Copy link
Copy Markdown
Member Author

@claude review

@graphite-app

graphite-app Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Merge activity

@graphite-app
graphite-app Bot force-pushed the om/06-29-refactor_ast_tools_enumdef_inherits_enums_return_iterator_of_enumdef_s branch from bb3a201 to 84f8e5b Compare June 30, 2026 13:05
graphite-app Bot pushed a commit that referenced this pull request Jun 30, 2026
`EnumDef::inherits_enums` returns an iterator of enums that an enum _directly_ inherits from.

Add a method `EnumDef::all_inherits` which yields _all_ inherited enums, including that which are inherited from transitively.

e.g.:

- `AssignmentTarget` inherits `SimpleAssignmentTarget` and `AssignmentTargetPattern`
- `SimpleAssignmentTarget` inherits `MemberExpression`.

The 2 methods returns iterators yielding:

- `inherits_enums`: `SimpleAssignmentTarget`, `AssignmentTargetPattern`
- `all_inherits`: `SimpleAssignmentTarget`, `MemberExpression`, `AssignmentTargetPattern`

Use the new `AllInheritsIter` iterator to simplify the `AllVariantsIter` iterator.
@graphite-app
graphite-app Bot force-pushed the om/06-29-feat_ast_tools_add_enumdef_all_inherits_method branch from ef7bdaf to d917fdb Compare June 30, 2026 13:05
@camc314

camc314 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: d917fdb8d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: d917fdb8d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

`EnumDef::inherits_enums` returns an iterator of enums that an enum _directly_ inherits from.

Add a method `EnumDef::all_inherits` which yields _all_ inherited enums, including that which are inherited from transitively.

e.g.:

- `AssignmentTarget` inherits `SimpleAssignmentTarget` and `AssignmentTargetPattern`
- `SimpleAssignmentTarget` inherits `MemberExpression`.

The 2 methods returns iterators yielding:

- `inherits_enums`: `SimpleAssignmentTarget`, `AssignmentTargetPattern`
- `all_inherits`: `SimpleAssignmentTarget`, `MemberExpression`, `AssignmentTargetPattern`

Use the new `AllInheritsIter` iterator to simplify the `AllVariantsIter` iterator.
@overlookmotel
overlookmotel force-pushed the om/06-29-refactor_ast_tools_enumdef_inherits_enums_return_iterator_of_enumdef_s branch from 84f8e5b to a10ac8f Compare June 30, 2026 14:46
@overlookmotel
overlookmotel force-pushed the om/06-29-feat_ast_tools_add_enumdef_all_inherits_method branch from d917fdb to 1bb1702 Compare June 30, 2026 14:46
Base automatically changed from om/06-29-refactor_ast_tools_enumdef_inherits_enums_return_iterator_of_enumdef_s to main June 30, 2026 16:22
@graphite-app
graphite-app Bot merged commit 1bb1702 into main Jun 30, 2026
39 of 55 checks passed
@graphite-app
graphite-app Bot deleted the om/06-29-feat_ast_tools_add_enumdef_all_inherits_method branch June 30, 2026 16:24
camc314 pushed a commit that referenced this pull request Jul 3, 2026
`EnumDef::inherits_enums` returns an iterator of enums that an enum _directly_ inherits from.

Add a method `EnumDef::all_inherits` which yields _all_ inherited enums, including that which are inherited from transitively.

e.g.:

- `AssignmentTarget` inherits `SimpleAssignmentTarget` and `AssignmentTargetPattern`
- `SimpleAssignmentTarget` inherits `MemberExpression`.

The 2 methods returns iterators yielding:

- `inherits_enums`: `SimpleAssignmentTarget`, `AssignmentTargetPattern`
- `all_inherits`: `SimpleAssignmentTarget`, `MemberExpression`, `AssignmentTargetPattern`

Use the new `AllInheritsIter` iterator to simplify the `AllVariantsIter` iterator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants