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

NamedOp::name should always return scoped names. #1496

Open
aborgna-q opened this issue Sep 2, 2024 · 1 comment
Open

NamedOp::name should always return scoped names. #1496

aborgna-q opened this issue Sep 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@aborgna-q
Copy link
Collaborator

// Consider a noop operation
op: Optype = prelude::Noop.to_extension_op().into()

// This returns the fully scoped name 
assert_eq!(<op as NamedOp>::name(), "prelude.Noop");

// But the same operation on the noop definition returns something different
assert_eq!(<NoopDef as NamedOp>::name(), "Noop");

// So the name can't be used as an unique id
assert_ne!(op.name(), NoopDef.name());

Since we expect names to be used as unique identifiers for the functions, they should always include the extension ids.

@aborgna-q aborgna-q added the bug Something isn't working label Sep 2, 2024
@ss2165 ss2165 added this to the hugr-rs 0.12.1 / hugr-py 0.8.1 milestone Sep 2, 2024
@aborgna-q
Copy link
Collaborator Author

Note that this change will be a breaking release. We'll have to rely on workarounds for the current version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants