Skip to content

Fix pyright unreachable case - #11370

Merged
Graham Wheeler (gramster) merged 2 commits into
microsoft:mainfrom
gramster:fix-pyright-unreachable-case
Apr 8, 2026
Merged

Graham Wheeler (gramster) merged 2 commits into
microsoft:mainfrom
gramster:fix-pyright-unreachable-case

Conversation

@gramster

@gramster Graham Wheeler (gramster) commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

Tracks whether an indeterminate entry was spliced out to contract the tuple to fit a shorter pattern in match statements. This preserves "potential match" semantics.

Fixed #11249

Jackson Cooper (jacks0n) and others added 2 commits April 8, 2026 09:42
…led (#11239)

The handleInitialized method was not calling updateSettingsForAllWorkspaces() when hasWorkspaceFoldersCapability was true, leaving workspaces with unresolved isInitialized.promise. This caused any code awaiting this promise to hang forever.

Restructure the method to always call updateSettingsForAllWorkspaces() regardless of workspace folders capability.

Initial plan

Initial investigation plan

Co-authored-by: gramster <[email protected]>

Fix tuple pattern matching regression for unpacked variadic tuples

Co-authored-by: gramster <[email protected]>

Complete fix validation - all tests pass

Co-authored-by: gramster <[email protected]>

Add comment for removedIndeterminate flag and regression test

Agent-Logs-Url: https://github.com/gramster/pyright/sessions/e717a85e-44f9-46d9-8ce1-1e94af0c0285

Co-authored-by: gramster <[email protected]>
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

sympy (https://github.com/sympy/sympy)
-   .../projects/sympy/sympy/vector/implicitregion.py:188:18 - error: Operator "/" not supported for types "int | Unknown" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
+   .../projects/sympy/sympy/vector/implicitregion.py:188:18 - error: Operator "/" not supported for types "int | Unknown" and "Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
-   .../projects/sympy/sympy/vector/implicitregion.py:189:18 - error: Operator "/" not supported for types "int | Unknown" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
+   .../projects/sympy/sympy/vector/implicitregion.py:189:18 - error: Operator "/" not supported for types "int | Unknown" and "Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
-   .../projects/sympy/sympy/vector/implicitregion.py:190:18 - error: Operator "/" not supported for types "int | Unknown" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
+   .../projects/sympy/sympy/vector/implicitregion.py:190:18 - error: Operator "/" not supported for types "int | Unknown" and "Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
-   .../projects/sympy/sympy/vector/implicitregion.py:206:18 - error: Operator "*" not supported for types "Unknown | Expr | Any" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
+   .../projects/sympy/sympy/vector/implicitregion.py:206:18 - error: Operator "*" not supported for types "Unknown | Expr | Any" and "Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
-   .../projects/sympy/sympy/vector/implicitregion.py:210:18 - error: Operator "*" not supported for types "Unknown | Expr | Any" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
+   .../projects/sympy/sympy/vector/implicitregion.py:210:18 - error: Operator "*" not supported for types "Unknown | Expr | Any" and "Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
-   .../projects/sympy/sympy/vector/implicitregion.py:214:18 - error: Operator "*" not supported for types "Unknown | Expr | Any" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
+   .../projects/sympy/sympy/vector/implicitregion.py:214:18 - error: Operator "*" not supported for types "Unknown | Expr | Any" and "Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"

jax (https://github.com/google/jax)
+   .../projects/jax/jax/_src/pallas/mosaic/sc_lowering.py:785:11 - error: "log_buffer" is not a known attribute of module "jaxlib.mosaic.python.tpu" (reportAttributeAccessIssue)
+   .../projects/jax/jax/_src/pallas/mosaic/sc_lowering.py:787:11 - error: "log" is not a known attribute of module "jaxlib.mosaic.python.tpu" (reportAttributeAccessIssue)
- 3071 errors, 83 warnings, 0 informations
+ 3073 errors, 83 warnings, 0 informations

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved via Review Center.

@gramster
Graham Wheeler (gramster) merged commit 50a5385 into microsoft:main Apr 8, 2026
16 checks passed
@gramster
Graham Wheeler (gramster) deleted the fix-pyright-unreachable-case branch April 9, 2026 16:52
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.

Pyright incorrectly marks a match case as unreachable (regression in 1.1.408)

3 participants