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

Synchronize TypeVariableKind and Kind #6067

Closed
Tracked by #6191
michaeljklein opened this issue Sep 17, 2024 · 0 comments · Fixed by #6094
Closed
Tracked by #6191

Synchronize TypeVariableKind and Kind #6067

michaeljklein opened this issue Sep 17, 2024 · 0 comments · Fixed by #6094
Labels
enhancement New feature or request

Comments

@michaeljklein
Copy link
Contributor

Problem

Kind and TypeVariableKind currently have different behavior for the same name (Normal) and because of it, Type::kind() -> Option<Kind> currently ignores TypeVariableKind info.

Happy Case

  • Match kinds between TypeVariableKind and Kind
    • Make TypeVariableKind::Normal correspond to Kind::Normal or else rename to avoid confusion
      • This may require adding some sort of Kind::Any/Kind::Unresolved or propagating a lot more Kind information, e.g. in the generics in Type::Forall
      • This will allow removing None as an "any" kind in Type::kind
  • Use the matched kinds to allow Type::kind() on type variables to account for the TypeVariableKind
  • Add tests to ensure moving between types that use Kind (e.g. Type::Constant) and type variables preserves the kind

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@michaeljklein michaeljklein added the enhancement New feature or request label Sep 17, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Sep 17, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 1, 2024
# Description

## Problem\*

Resolves #6067

## Summary\*

- Combines `TypeVariableKind` and `Kind` (now only `Kind`)
- Adds `Kind` arguments where needed
- Adds more `Kind` checks

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant