Skip to content

Incorrect return value is not detected for methods with a template return type since 5.3 #9245

@vudaltsov

Description

@vudaltsov

This code has an error on line 23 (should return int, not string).

https://psalm.dev/r/aa26301af0

Removing the mixed return type fixes the issue: https://psalm.dev/r/6bf5cdea8a.

Regression occurred in #8926.

Commit da001c4 is the last one, when Psalm reports the problem (correct behavior).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions