phan icon indicating copy to clipboard operation
phan copied to clipboard

`@return mixed` annotation suppressed errors about nulls being used even with `allow_overriding_vague_return_types` set to true

Open Func86 opened this issue 1 year ago • 0 comments

Reproduce

With allow_overriding_vague_return_types set to true:

/**
 * @return mixed
 */
function returns_nullable() {
	// if ... return sth not null
	return null;
}
echo returns_nullable();

Expected

PhanTypeSuspiciousEcho Suspicious argument returns_nullable() of type null for an echo/print statement

Func86 avatar Apr 23 '24 00:04 Func86