Skip to content

Additional keys in inherited return type array shapes #3204

@ComiR

Description

@ComiR

Bug report

When inheriting or implementing a function with an annotated return type array shape, the child functions / function implementations return type cannot have extra keys.

Code snippet that reproduces the problem

Inheritance https://phpstan.org/r/3814321a-eefa-4e2b-acec-7de18138e6a9
Interface https://phpstan.org/r/196b7452-8f31-4e6e-a349-ca35f32f09fb

Expected output

Return value should be able to contain extra keys.

For parameters it should be the other way round.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions