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

LoadFunction::signature's documentation does not match it's uses #1755

Closed
doug-q opened this issue Dec 10, 2024 · 0 comments · Fixed by #1756
Closed

LoadFunction::signature's documentation does not match it's uses #1755

doug-q opened this issue Dec 10, 2024 · 0 comments · Fixed by #1756
Assignees

Comments

@doug-q
Copy link
Collaborator

doug-q commented Dec 10, 2024

documentation: "The instantiation of func_sig".

Here, instantiation means the Signature of the target polymorphic function after the type args of the LoadFunction op are substituted.

it is used as the the signature of the op.

This new function on impl LoadFunction would give the instantiation:

    pub fn instantiation(&self) -> Signature {
        let TypeEnum::Function (ty) = self.signature.output[0].as_type_enum() else {
            panic!("")
        };
        ty.as_ref().clone().try_into().unwrap()
    }

I suggest that rather than implement the above function, we rename signature -> instantiation, and that all uses are changed to call DataflowOpTrait::signature() which would be redefined to compute the signature from the instantiation.

doug-q added a commit that referenced this issue Dec 10, 2024
…tion`

Closes #1755

BREAKING CHANGE: The `LoadFunction::signature` field is removed. Replace
uses with `DataflowOpTrait::signature()`.
@doug-q doug-q self-assigned this Dec 10, 2024
@doug-q doug-q added this to the hugr-rs 0.14 / hugr-py 0.10 milestone Dec 10, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 11, 2024
…tion` (#1756)

Closes #1755

This change breaks serialisation. We will already break serialisation
with the next release, so we judge this to be acceptable.

BREAKING CHANGE: The `LoadFunction::signature` field is removed. Replace
uses with `DataflowOpTrait::signature()`.
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 a pull request may close this issue.

1 participant