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: Arbitrary types in the yaml extension definition #839

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

aborgna-q
Copy link
Collaborator

The current yaml extension definitions only support hard-coded types in the operation signatures.

This PR leaves the existing Q and USize hardcoded values, but tries to dereference the type name from the extensions in scopes otherwise.

drive-by: Extend the module doc with an example on how to load the extension.

@aborgna-q
Copy link
Collaborator Author

aborgna-q commented Feb 20, 2024

This is still a work-in-progress definition, as we don't have a scheme for the declarative extensions in the spec.

In particular, name resolution is a bit fuzzy. Right now it just matches on type names (using Extension::get_tipe), as we don't have any utility to recognise an extension name from the declared identifier.

See #841

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.

just a variable name change suggestion

ext: ext.name().clone(),
ty: self.0.clone(),
})?;
let Some(op_def) = self.resolve_type(ext, ctx) else {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let Some(op_def) = self.resolve_type(ext, ctx) else {
let Some(type_def) = self.resolve_type(ext, ctx) else {

@aborgna-q aborgna-q added this pull request to the merge queue Feb 21, 2024
Merged via the queue into main with commit 4a4834c Feb 21, 2024
8 checks passed
@aborgna-q aborgna-q deleted the feat/decl-yaml-custom-types branch February 21, 2024 12:25
@github-actions github-actions bot mentioned this pull request Feb 20, 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.

2 participants