Skip to content

Error „should return static(Test) but returns Test“ #2885

@dg

Description

@dg
class Test
{
	/** @return static */
	function do()
	{
		return $this->do()->do();
	}
}

This generates error Method Test::do() should return static(Test) but returns Test.

https://phpstan.org/r/6307080e-727f-4a61-a816-f3e355ab9fc4

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