Skip to content

Conversation

sbillig
Copy link
Collaborator

@sbillig sbillig commented Aug 28, 2025

Deduping by TyId would result in erroneous diagnostics when there are two trait impls for a given type, where the impls have associated types with the same name and type. For example, in this test case, there would be an error on the return type of Foo's implementation of fn sub.

trait Add<T = Self> {
    type Output = Self
    fn add(self: Self, _ rhs: T) -> Self::Output
}
trait Sub<T = Self> {
    type Output = Self
    fn sub(self: Self, _ rhs: T) -> Self::Output
}

struct Foo {}

impl Add for Foo {
    fn add(self: Self, _ rhs: Self) -> Self { self }
}
impl Sub for Foo {
    fn sub(self: Self, _ rhs: Self) -> Self { self }
}

deduping by TyId would result in erroneous diagnostics
@sbillig sbillig merged commit c9f0bfe into argotorg:master Aug 29, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants