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

feat!: Return the type of FuncDecl in HugrView::get_function_type #880

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

aborgna-q
Copy link
Collaborator

get_function_type was confusing, as it didn't specify that it only worked for dataflow containers, and required manually checking for function declarations on the side.

BREAKING CHANGE: HugrView::get_function_type now returns a PolyFuncType.

BREAKING CHANGE: `HugrView::get_function_type` now returns a `PolyFuncType`.
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 85.57%. Comparing base (d5294ad) to head (0a3aa78).
Report is 1 commits behind head on main.

Files Patch % Lines
quantinuum-hugr/src/hugr/views.rs 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #880      +/-   ##
==========================================
+ Coverage   85.49%   85.57%   +0.07%     
==========================================
  Files          78       78              
  Lines       14456    14458       +2     
  Branches    14456    14458       +2     
==========================================
+ Hits        12359    12372      +13     
+ Misses       1460     1450      -10     
+ Partials      637      636       -1     

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

@ss2165
Copy link
Member

ss2165 commented Mar 14, 2024

We discussed this a lot in #754 and the follow up #782

I still think that getting a FunctionType when applicable rather than a PolyFuncType is useful, and the latter only applies to two node types. I would perhaps suggest a non-breaking additional function that does what you want.

@aborgna-q
Copy link
Collaborator Author

Could the previous get_function_type be renamed to get_df_function_type or something similar?
I had to spend some time tracking down the function calls to see why the FuncDecl match was necessary.

#881 will use this generic version in multiple places.

@ss2165
Copy link
Member

ss2165 commented Mar 14, 2024

yeah I don't mind that

@aborgna-q aborgna-q requested a review from croyzor March 18, 2024 10:45
@aborgna-q aborgna-q added this pull request to the merge queue Mar 18, 2024
Merged via the queue into main with commit 9ef7808 Mar 18, 2024
10 checks passed
@aborgna-q aborgna-q deleted the feat/get-function-type branch March 18, 2024 11:10
@github-actions github-actions bot mentioned this pull request Mar 18, 2024
@github-actions github-actions bot mentioned this pull request Apr 15, 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.

3 participants