Skip to content

figure out why we get ambiguity for this futures example #111

@nikomatsakis

Description

@nikomatsakis

Given the traits/types found in this gist:

https://gist.github.com/nikomatsakis/58717b0588393ca14f2d6168e7c86188

Why do we get ambiguity here?

> target/debug/chalki --program=$HOME/tmp/futures-model.chalk --goal='forall<T> { if (T: FutureResult) { exists<I, E> { T: Future<Output = Result<I, E>> } } }'
Ambiguous; no inference guidance

Note that if we (hackily) don't force the solver to give us back a result for I and E, we get Unique as expected:

> target/debug/chalki --program=$HOME/tmp/futures-model.chalk --goal='forall<T> { if (T: FutureResult) { T: Future, exists<I, E> { T: Future<Output = Result<I, E>> } } }'
Unique; substitution [], lifetime constraints []

cc @scalexm, who wanted to investigate this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions