enlightware / enlightware/ferlium
Support per-trait-method generics and constraints
- Dominant language
- Rust
- Stars
- 14
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Currently Ferlium does not support per-trait-method constraints, preventing writing something like this:
```
trait Coll {
type Item;
type Iter;
fn len(self: &Self) -> Int;
fn iter(self: &Self) -> Iter where Iter: Iterator;
fn from_iter(iter: Iter) -> Self where Iter: Iterator;
}
```
In that example, the constraint `Iter: Iterator` cannot be stored at the trait level because the associated types couldn't be retrieved for the `len()` method. And while they are not necessary for the `len()` method, they are for the `iter`-related ones.
This requires a review of the part of the `emit_functions` function in `emit_ir`, in particular how the constraints are processed and in which order. Most likely this requires also addressing #44.
Contributor guide
Assessment
This issue has not been assessed yet.