noir icon indicating copy to clipboard operation
noir copied to clipboard

feat: check trait where clause

Open asterite opened this issue 1 year ago • 0 comments

Description

Problem

Resolves #6023

Summary

It turns out that checking a trait's where clause is very similar to checking parent traits: for parent traits the type to check if Self, for where clause it's the specified type. So trait Foo where Self: Constraint is the same as trait Foo: Constraint. I thought about unifying the code to only have a single list of constraints but I don't know if it's worth it (we could maybe give different errors in one case or another, though right now the errors are the same).

There's a chance this PR is a breaking change, because when I finished implementing it one test broke and I had to amend it.

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 and/or cargo fmt on default settings.

asterite avatar Oct 23 '24 17:10 asterite