Skip to content

Generic with explicit argument as template type bound #2928

@hrach

Description

@hrach

Bug report

Using generic type as template bound doesn't accept explicit generic argument.

https://phpstan.org/r/93677d60-da20-4a8f-b6c7-071e017ca6f4

/** @template E */
interface Foo {}

interface A {
	/**
	 * @template T of Foo<string>
	 * @param T $a
	 */
	function x($a): void;
}

Currently gives Method A::x() has parameter $a with generic interface Foo but does not specify its types: E

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions