Skip to content

fix: look for associated types on parent traits and impls#11745

Open
guipublic wants to merge 3 commits intomasterfrom
gd/issue_11562
Open

fix: look for associated types on parent traits and impls#11745
guipublic wants to merge 3 commits intomasterfrom
gd/issue_11562

Conversation

@guipublic
Copy link
Contributor

Description

Problem

Resolves #11562

Summary

Look for associated types in the parents hierarchy for traits and trait impls.
Trait constraints are added for both parent traits and trait impls.

Additional Context

User Documentation

Check one:

  • No user documentation needed.
  • Changes in docs/ included in this PR.
  • [For Experimental Features] Changes in docs/ to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Brillig Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: ab51b64 Previous: a48028f Ratio
private-kernel-tail 0.005 s 0.004 s 1.25

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: ab51b64 Previous: a48028f Ratio
rollup-checkpoint-merge 0.003 s 0.002 s 1.50

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@guipublic guipublic requested a review from a team March 3, 2026 17:38
@asterite
Copy link
Collaborator

asterite commented Mar 4, 2026

I'll review this now, but I noticed that (I think!) we don't have a test for when an associated type is defined in both the parent and the child:

trait KeyType {
    type Key;
}

trait Lookup: KeyType {
    type Key;
}

fn find<M: Lookup>(m: M, key: M::Key) {}

It works as expected, producing an ambiguity error, but I couldn't find such test.

@guipublic
Copy link
Contributor Author

I'll review this now, but I noticed that (I think!) we don't have a test for when an associated type is defined in both the parent and the child: (...)

I added the test.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 83ae00e Previous: 95fc5e9 Ratio
test_report_zkpassport_noir_rsa_ 2 s 1 s 2

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

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.

Accessing associated types of parent trait fails in type signatures

2 participants