Skip to content

[Lean] Equality constraints on associated types of parent trait #1923

@abentkamp

Description

@abentkamp

Equality constraints on associated types of parent trait don't work well with Lean's type class search:

trait T1 {
    type A1;
    fn mkA1() -> Self::A1;
}

trait T2: T1 {}

fn m<T: T2<A1 = u8>>() -> u8 {
    T::mkA1()
}

impl T1 for bool {
    type A1 = u8;
    fn mkA1() -> u8 {
        0
    }
}

impl T2 for bool {}

fn test() -> u8 {
    m::<bool>()
}

https://hax-playground.cryspen.com/#fstar/latest-main/gist=bd6e8f2de5ed1832941dae51e093f1a5

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Max prioritybackendIssue in one of the backends (i.e. F*, Coq, EC...)leanRelated to the Lean backend or library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions