Skip to content

feat(traits): Implement trait bounds def collector + resolver passes#2716

Merged
jfecher merged 7 commits intonoir-lang:masterfrom
metacraft-labs:trait-bounds-1
Sep 20, 2023
Merged

feat(traits): Implement trait bounds def collector + resolver passes#2716
jfecher merged 7 commits intonoir-lang:masterfrom
metacraft-labs:trait-bounds-1

Conversation

@alexvitkov
Copy link
Contributor

This needs to be merged after #2652 - this PR also unfortunately includes the changes from that and the diff is currently quite ugly

Problem*

Summary*

Progress on #2568

This is the first part of a two-episode series on Trait Bounds. It turned out quite big, so I've split it into two - the next PR adds the type checker & monomorphizer for where clauses which is the majority of the work, this is some setup work that needs to get done in the early passes.

Changes:

  • renamed trait AST structures to follow the convention of other structs: Trait -> NoirTrait and TraitImpl -> NoirTraitImp
  • added find_trait_or_emit_error which is helpful when walking over the where clause
  • when resolving functions, go over their where_clause and bind TraitIds to the UnresolvedTraitConstraints

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@alexvitkov alexvitkov marked this pull request as ready for review September 20, 2023 04:54
Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

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

Since other PRs depend on this, I'll make my own PR to fix the small nits so that we can merge this one now.

@jfecher jfecher enabled auto-merge September 20, 2023 16:06
@jfecher jfecher added this pull request to the merge queue Sep 20, 2023
Merged via the queue into noir-lang:master with commit e3d18bb Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants