Skip to content

incorrect type inference with dependent types #14211

Closed

Description

@claudepache

Bug report

Regression introduced by phpstan/phpstan-src@c5bfadb

See code snippet.

Code snippet that reproduces the problem

https://phpstan.org/r/2c32da67-4483-4893-bdb3-81906ffc4461

Expected output

Line 17: Dumped type: true

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

No response

Activity

  1. VincentLanglet commented on Feb 28, 2026

    @VincentLanglet
    Contributor

    Regression introduced by phpstan/phpstan-src@c5bfadb

    cc @staabm

  2. self-assigned this
    on Feb 28, 2026
  3. staabm commented on Feb 28, 2026

    @staabm
    Contributor

    hmm I think the root cause of this bug is not the change of phpstan/phpstan-src@c5bfadb but a deeper bug in conditional type handling, which got accidentally compensated by the always beeing invoked TypeCombinator::intersect calls which no longer happen after said commit

  4. staabm commented on Feb 28, 2026

    @staabm
    Contributor

    @claudepache thanks for testing non released work and reporting regressions.

    Thats very valuable

  5. MacGritsch commented on Mar 3, 2026

    @MacGritsch

    #14117 might be a duplicate of this one?

  6. phpstan-bot commented on Apr 1, 2026

    @phpstan-bot
    Collaborator

    Closed via merging phpstan/phpstan-src#5373

  7. 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.

  8. 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

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions