Skip to content

float template bound type support #5331

@b1rdex

Description

@b1rdex

Bug report

https://phpstan.org/r/f68251de-0b7c-48fb-b174-549b2bd0a933

class HelloWorld
{
	/**
     * @template A of int
	 * @template B of float
     * @template C of number
	 * @template D of int|float
	 * @return C
     */
    public function minifs()
    {
	}
}
  1. B, C and D = bound type float is not supported
  2. Method HelloWorld::minifs() should return C of float|int but return statement is missing

IMO, this looks like a bug – PHPStan understands the bound type but still complains that it isn't supported.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions