Skip to content

Incorrect type narrowing with dependent types #14411

Closed

Description

@claudepache

Bug report

Since 2.1.45. See code snippet.

Code snippet that reproduces the problem

https://phpstan.org/r/4b557d4b-6dac-4bdd-8758-b97ecd0a9ef0

Expected output

No error on line 22.

Did PHPStan help you today? Did it make you happy in any way?

No response

Activity

  1. added this to the Easy fixes milestone on Mar 31, 2026
  2. added 3 commits that reference this issue on Mar 31, 2026
    f1f428d
    b07a1ab
    f6ed6bd
  3. added a commit that references this issue on Apr 1, 2026
    4e6a1a8
  4. phpstan-bot commented on Apr 1, 2026

    @phpstan-bot
    Contributor

    Closed via merging phpstan/phpstan-src#5373

  5. added 3 commits that reference this issue on Apr 1, 2026
    4e6a1a8
    830c5cc
    a2503d7
  6. github-actions commented on May 3, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  7. locked as resolved and limited conversation to collaborators on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions