Skip to content

Check that generated ast respects type hints #48

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

Merged
merged 7 commits into from
Jun 20, 2023

Conversation

PhilReinhold
Copy link
Collaborator

@PhilReinhold PhilReinhold commented Jun 19, 2023

We should try to always produce "valid" AST in accordance with the type hints defined on the AST dataclasses. We can check this mechanically in the tests.

There are two failures arising from the AST type hints themselves. A trivial failure comes from a failure in openpulse.ast to import typing.Union which causes type hint evaluation to fail. A less trivial failure is the fact that openqasm.ArrayDefinition doesn't allow DurationType for base_type. We should clarify if this is intended or not.

Edit: both failures are resolved in updated versions of the openpulse/openqasm dependencies.

Copy link
Collaborator

@jcjaskula-aws jcjaskula-aws left a comment

Choose a reason for hiding this comment

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

Good to go. We need to:

  • close #25
  • open an issue to check element type in collections.

@PhilReinhold PhilReinhold merged commit 25b2dec into main Jun 20, 2023
@jcjaskula-aws jcjaskula-aws deleted the pcrein/check-respects-type-hints branch June 17, 2024 15:56
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