Skip to content

Fix pyright unreachable case#11370

Merged
gramster merged 2 commits intomicrosoft:mainfrom
gramster:fix-pyright-unreachable-case
Apr 8, 2026
Merged

Fix pyright unreachable case#11370
gramster merged 2 commits intomicrosoft:mainfrom
gramster:fix-pyright-unreachable-case

Conversation

@gramster
Copy link
Copy Markdown
Member

@gramster gramster commented Apr 8, 2026

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

jacks0n and others added 2 commits April 8, 2026 09:42
…led (microsoft#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 <2762632+gramster@users.noreply.github.com>

Fix tuple pattern matching regression for unpacked variadic tuples

Co-authored-by: gramster <2762632+gramster@users.noreply.github.com>

Complete fix validation - all tests pass

Co-authored-by: gramster <2762632+gramster@users.noreply.github.com>

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 <2762632+gramster@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

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

Copy link
Copy Markdown
Collaborator

@rchiodo rchiodo left a comment

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 gramster merged commit 50a5385 into microsoft:main Apr 8, 2026
16 checks passed
gramster added a commit to gramster/pyright that referenced this pull request Apr 9, 2026
…led (microsoft#11239) (microsoft#11370)

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.

Fixes microsoft#11249
@gramster 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