-
Notifications
You must be signed in to change notification settings - Fork 11
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
Type checking and casting in classical declaration statements #203
Labels
required feature
Feature or behavior in OQ3 spec, needs implementation
Comments
jlapeyre
added a commit
to jlapeyre/openqasm3_parser
that referenced
this issue
Mar 28, 2024
Implement checking compatibility of types of lhs and rhs in classical assignment statement. If an implicit cast is needed, add an explicit cast. Prior to this commit there was essentially nothing in place to do these things (just a very small amount, and broken at that). This is certainly not the end of the story. There will be edge cases. But this is a good start which should capture many common scenarios. Since we are developing quickly and writing tests for this ASG is very tedious and verbose, we have not been testing very carefully. However, the kind of thing done in this commit is inherently fragile, so we need to begin with more testing. Closes Qiskit#203
jlapeyre
added a commit
to jlapeyre/openqasm3_parser
that referenced
this issue
Mar 28, 2024
Implement checking compatibility of types of lhs and rhs in classical assignment statement. If an implicit cast is needed, add an explicit cast. Prior to this commit there was essentially nothing in place to do these things (just a very small amount, and broken at that). This is certainly not the end of the story. There will be edge cases. But this is a good start which should capture many common scenarios. Since we are developing quickly and writing tests for this ASG is very tedious and verbose, we have not been testing very carefully. However, the kind of thing done in this commit is inherently fragile, so we need to begin with more testing. Closes Qiskit#203
jlapeyre
added a commit
that referenced
this issue
Mar 28, 2024
Implement checking compatibility of types of lhs and rhs in classical assignment statement. If an implicit cast is needed, add an explicit cast. Prior to this commit there was essentially nothing in place to do these things (just a very small amount, and broken at that). This is certainly not the end of the story. There will be edge cases. But this is a good start which should capture many common scenarios. Since we are developing quickly and writing tests for this ASG is very tedious and verbose, we have not been testing very carefully. However, the kind of thing done in this commit is inherently fragile, so we need to begin with more testing. Closes #203
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is not implemented (well not correctly. But the existing check is bad enough that I would call it just unimplemented)
For example, the following parses to ASG without error:
And if types are compatible with implicit casting, the
Cast
operation should be added, but it is not.The text was updated successfully, but these errors were encountered: