Skip to content

Generic Error message points to Column<T> instead of the incompatible value #14872

Description

@kitrio

Bug report

This code is query builder using php doc generics.

psalm, mago is correct but phpstan is show reverse message.
I tested Mago and Psalm the results came out correctly, but phpstan's error message is based on the first parameter.

Code snippet that reproduces the problem

https://phpstan.org/r/7b51d8a5-3deb-4aee-a0cb-10955b448f54

Expected output

I expect messge: Parameter #1 $column of method Builder::where() expects Column IntColumn, <'test_string_value'> given.

sorry poor expect message
I explained it in detail in the comment below.

  • modified expect 2026-june-27:

But Phpstan print this.
Parameter #1 $column of method Builder::where() expects Column<'test_string_value'|int>, IntColumn given.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions