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

RCA check reports error only on entry point rather than also on the line generating the required capability #1537

Closed
swernli opened this issue May 16, 2024 · 0 comments · Fixed by #1543
Labels
bug Something isn't working needs triage

Comments

@swernli
Copy link
Collaborator

swernli commented May 16, 2024

With the following code, RCA produces the expected error message but only on the entry point rather than on the line that produced the dynamic string (playground):

namespace MyQuantumProgram {
    operation ApplyAndMeasure(op : Qubit => Unit, q : Qubit) : Bool {
        op(q);
        return MResetZ(q) == One;
    }

    @EntryPoint()
    operation Main() : Result[] {
        use q = Qubit();
        let b = ApplyAndMeasure(H, q);
        let s = b ? "One" | "Zero";
        
        return [];
    }
}

The is reported at Main() which is expected but missing from let s = b ? "One" | "Zero";

@swernli swernli added bug Something isn't working needs triage labels May 16, 2024
swernli added a commit that referenced this issue May 17, 2024
This fixes minor issues in error spans used when reporting RCA check errors to avoid duplicate errors being reported for generated entry expressions that come from `@EntryPoint` attributed callables in standalone Q# files.

Fixes #1537.
github-merge-queue bot pushed a commit that referenced this issue May 20, 2024
This fixes minor issues in error spans used when reporting RCA check
errors to avoid duplicate errors being reported for generated entry
expressions that come from `@EntryPoint` attributed callables in
standalone Q# files.

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

Successfully merging a pull request may close this issue.

1 participant