• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 34215581765
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: patch-lcov-errors
DEFAULT BRANCH: main
Ran 08 Sep 2026 10:59AM UTC
Jobs 1
Files 963
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Sep 2026 10:27AM UTC coverage: 87.862% (+0.005%) from 87.857%
34215581765

push

github

web-flow
Fix control-flow builder overloads for static type checkers (#16899)

* Fix control-flow builder overloads for static type checkers

The `typing.overload` signatures for `QuantumCircuit.for_loop`, `while_loop`
and `switch` declared `body`/`cases`, `qubits`, `clbits` and `label` without
defaults, even though the implementations default all of them. Type checkers
validate call sites against the overloads only and ignore the implementation
signature, so the documented context-manager form
`with qc.for_loop(range(5)) as i:` was reported as matching no overload, and
the explicit forms were rejected for omitting `label`. Both already worked at
runtime.

Also widen annotations to admit `expr.Expr` where the implementations already
accept it: the `condition` of `if_test` and `if_else` (both route through
`validate_condition`, which takes `tuple[...] | expr.Expr`), and the `target`
of `switch` (`SwitchCaseOp` and `SwitchContext` both annotate it as accepting
`expr.Expr` and branch on it explicitly).

* Document Expr conditions and targets in control-flow builder docstrings

The docstrings for `while_loop`, `if_test`, `if_else` and `switch` described
only the two-tuple condition form and, for `switch`, only a register or bit
target. All four have accepted `expr.Expr` since real-time classical
expressions were added, so the docs now list the `Expr` form first, followed
by the legacy two-tuple form. For `switch`, an `Expr` target must be `Uint(n)`
or `Bool()`, which mirror `ClassicalRegister(n)` and `Clbit` respectively
-- both branches derive the same bit width used to bound case values.

Also corrects a typo in `switch`: "switch one" -> "switch on".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

116733 of 132859 relevant lines covered (87.86%)

983475.32 hits per line

Coverage Regressions

Lines Coverage ∆ File
5
92.03
0.26% crates/qasm2/src/lex.rs
1
90.31
0.0% crates/circuit/src/parameter/parameter_expression.rs
Jobs
ID Job ID Ran Files Coverage
1 34215581765.1 08 Sep 2026 10:59AM UTC 963
87.86
GitHub Action Run
Source Files on build 34215581765
  • Tree
  • List 963
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34215581765
  • ede116c5 on github
  • Prev Build on gh-readonly-queue/main/pr-16928-66f6f9ca4d5f60f45da37c7980247e38df067f6c (#34215338617)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc