Skip to content

Generics on primitives lost when inside generics #11126

@simonwelsh

Description

@simonwelsh

Bug report

When returning primitives with generics (such as non-negative-int) inside another generic value, the primitive loses the generic information and then errors.

This started in 1.11.2.

Code snippet that reproduces the problem

https://phpstan.org/r/ba89d165-7146-44e6-a11b-ac609b46daf1

Expected output

No errors

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions