Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float template bound type support #5331

Closed
b1rdex opened this issue Jul 19, 2021 · 2 comments
Closed

float template bound type support #5331

b1rdex opened this issue Jul 19, 2021 · 2 comments

Comments

@b1rdex
Copy link
Contributor

b1rdex commented Jul 19, 2021

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.

@ondrejmirtes ondrejmirtes added this to the Generics milestone Jul 19, 2021
@ondrejmirtes
Copy link
Member

Implemented: phpstan/phpstan-src@4e7d6c1

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants