Skip to content

No error reported when Template type is not specified #3589

@TomPavelec

Description

@TomPavelec

Bug report

When is omitted annotation that specifies Template type no error is reported.

Look at code snippet.
On lines 26-28 is good example, repository expects Id<Foo> type and Id<Foo> is given.
On lines 31-33 is error example, repository expects Id<Foo> but Id<Bar> is given and expected error is reported.

Problems are on lines 38-39
When annotation is omittetd / forgotten, whole use case is broken. Repository expects Id<Foo> but unspecified Id is given and no error is reported.

Code snippet that reproduces the problem

https://phpstan.org/r/b96abaaf-99b2-48d5-bb1a-f29462bfe337

Expected output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions