Skip to content

False positive with assert-if-true/if-false #5248

@klimick

Description

@klimick

If assert function has @psalm-assert-if-false and @psalm-assert-if-true at the same time then it works incorrectly:
https://psalm.dev/r/91745556ee

Quick workaround is drop @psalm-assert-if-false or @psalm-assert-if-true from assert function:
https://psalm.dev/r/a5500b4ed2

But above workaround doesn't work in more difficult cases:
https://psalm.dev/r/408248f46f

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions