PhpEnums icon indicating copy to clipboard operation
PhpEnums copied to clipboard

Incorrect use of templated parameters for static functions in templated interfaces

Open LuckyRu opened this issue 3 years ago • 3 comments

Example: https://psalm.dev/r/a2b077f2e5 Comment of @weirdan: https://github.com/vimeo/psalm/issues/2571#issuecomment-572011683

LuckyRu avatar Aug 18 '21 07:08 LuckyRu

Hmm, so we need to add the @template T of int|string line to each static methods, but using the same template name (T) would generate a "Duplicate template param T in docblock for EnumInterface::get" so we need to use another name… this is a bit annoying :/

ogizanagi avatar Aug 18 '21 08:08 ogizanagi

I think we don't need templates in static methods

LuckyRu avatar Aug 19 '21 05:08 LuckyRu

i guess this is the cause of this psalm error: Argument 1 of USState::accepts expects Elao\Enum\T, string provided

bendavies avatar Oct 01 '21 15:10 bendavies