microsoft / microsoft/qdk

Better user guidance on failure to capture non-const symbols in OpenQASM

Open
#2,419 0 comments 0 reactions 0 assignees View on GitHub
enhancement needs triage
Dominant language
Rust
Stars
1k
Forks
212
Avg merge
3d 8h
Merged PRs (30d)
65

Description

Following up on https://github.com/microsoft/qsharp/pull/2417#discussion_r2093301530, it looks like the error clean up exposed an issue with how `SemanticErrorKind::ExprMustBeConst` is used in `lower_ident_expr`. The error is very helpful, but no longer gets filed because symbol resolution doesn't return actual symbols that are non-const. We need to review the interaction with `try_get_existing_or_insert_err_symbol` to ensure the assumptions are compatible with the `lower_ident_expr`.

Contributor guide

Open the contributing guide

Research direction

Start by reading the lower_ident_expr handling of SemanticErrorKind::ExprMustBeConst and the interaction with try_get_existing_or_insert_err_symbol. Trace how non-const symbols are resolved, then verify that the intended user guidance is emitted when such a symbol is captured in OpenQASM.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.