Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Resolve types in Values and custom consts #1779

Merged
merged 5 commits into from
Dec 12, 2024

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Dec 12, 2024

Collects and resolves extensions in the types stored inside a Value. This includes the specified type of a Sum and other cached types.

Since we expect CustomConst's get_type method to always return signatures computed by a binary definition.

For some reason there's a random test on hugr-py that starts failing when we enable this:

=================================== FAILURES ===================================
______________________________ test_higher_order _______________________________
Error parsing package: Error resolving opaque operation: Error in signature of operation 'prelude.Noop' in Node(3): Type arguments of node did not match params declared by definition: Wrong number of type arguments: 0 vs expected 1 declared type parameters

The fix for #1774 that I'm submitting immediately after this PR fixes it so I'm skipping the test in this PR 🤷
I'll open an issue to investigate further after we make the release

@aborgna-q aborgna-q requested a review from ss2165 December 12, 2024 14:27
@aborgna-q aborgna-q requested a review from a team as a code owner December 12, 2024 14:27
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 78.33333% with 13 lines in your changes missing coverage. Please review.

Project coverage is 86.69%. Comparing base (5f5bce4) to head (0400335).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hugr-core/src/extension/resolution/types_mut.rs 62.85% 10 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1779      +/-   ##
==========================================
- Coverage   86.73%   86.69%   -0.05%     
==========================================
  Files         186      186              
  Lines       33990    34035      +45     
  Branches    30865    30910      +45     
==========================================
+ Hits        29481    29506      +25     
- Misses       2840     2857      +17     
- Partials     1669     1672       +3     
Flag Coverage Δ
python 92.35% <ø> (-0.23%) ⬇️
rust 86.12% <78.33%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ss2165 ss2165 left a comment

Choose a reason for hiding this comment

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

thanks for the nice comments :)

Comment on lines 47 to 49
OpType::Const(c) => {
let typ = c.get_type();
collect_type_exts(&typ, &mut used, &mut missing);
collect_value_exts(&c.value, &mut used, &mut missing);
}
Copy link
Member

Choose a reason for hiding this comment

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

nit: looks like the braces are no longer necessary

hugr-core/src/extension/resolution/types.rs Outdated Show resolved Hide resolved
aborgna-q and others added 2 commits December 12, 2024 14:38
Co-authored-by: Seyon Sivarajah <[email protected]>
@aborgna-q aborgna-q changed the title fix: Resolve types in Values and custom conts fix: Resolve types in Values and custom consts Dec 12, 2024
@aborgna-q aborgna-q enabled auto-merge December 12, 2024 14:47
@aborgna-q aborgna-q added this pull request to the merge queue Dec 12, 2024
Merged via the queue into main with commit 080eaae Dec 12, 2024
24 of 25 checks passed
@aborgna-q aborgna-q deleted the ab/const-extensions-reqs branch December 12, 2024 15:00
This was referenced Dec 12, 2024
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