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
Attempted to use a trait in a function with a where clause:
traitFoo<A>{fnfoo(self,x:A) -> bool;}// This works:// fn bar<T, U>(x: T, y: U) -> bool where T: Foo<U> {// x.foo(y)// }// This fails:fnbar<T,U,V>(x:(T,U),y:V) -> boolwhere(T,U):Foo<V>{
x.foo(y)}
Expected Behavior
Expected both functions to type check
Bug
The trait fails to resolve:
error: No method named 'foo' found fortype'(T, U)'
┌─ /Users/michaelklein/Coding/noir/equiv_trait_scratch/src/main.nr:31:5
│
31 │ x.foo(y)
│ --------
│
Aborting due to 1 previous error
To Reproduce
Project Impact
Nice-to-have
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Installation Method
None
Nargo Version
No response
NoirJS Version
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:
# Description
## Problem
Resolves#5186
## Summary
Looking for methods that are bound to trait constraints was already
working for `NamedGeneric`, but when the trait is on a composite type,
like `(T, U)` or even `(T, i32)` methods weren't lookup up in
constraints bound to those types.
We only lookup this in case the regular (`lookup_primitive_method`)
lookup fails to find something.
## Additional Context
None.
## 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.
Aim
Attempted to use a trait in a function with a
where
clause:Expected Behavior
Expected both functions to type check
Bug
The trait fails to resolve:
To Reproduce
Project Impact
Nice-to-have
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Installation Method
None
Nargo Version
No response
NoirJS Version
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: