You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Description
## Problem\*
Resolves#4540
## Summary\*
In the resolver, when `x: impl Trait` is encountered as a function
parameter,
it is desugared to:
```rust
fn function_name<T_impl_trait>(x: T_impl_trait) where T_impl_trait: Trait
```
## Additional Context
In the current iteration of this PR, `T[func_id]_impl_[trait_name]` is
checked for collisions and
incremented (`T[func_id]_impl_[trait_name]_N`) until there's no
collision.
Note that this PR adds a few ~unrelated cases where `TraitAsType` could
have arguments that were previously skipped:
https://github.com/noir-lang/noir/pull/4919/files#diff-52c7ae61478bab09a4d23320128eead3a88cde6a7be16fb8b070b5512d690bbdR1203
## Documentation\*
Check one:
- [ ] 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.
Problem
Noir already has limited support for
impl Trait
in a return type position. It should also supportimpl Trait
in a parameter position for consistency.Happy Case
impl Trait
in a parameter position is added.This is just sugar for a trait constraint on a generic parameter:
Project Impact
None
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: