Skip to content

TypeParseTreeException when using intersection types in psalm-assert tag #2409

@andrew-demb

Description

@andrew-demb
/**
 * @psalm-assert array<string,string|object> $data
*/
function validate(array $data): void
{    
}

Expected: successfully parsed assert tag
Actual: Got TypeParseTreeException

https://psalm.dev/r/995018361e

Psalm runner output:

Internal Psalm error on line 571 - /var/www/vhosts/psalm.dev/httpdocs/vendor/vimeo/psalm/src/Psalm/Internal/Type/ParseTree.php: Unterminated bracket

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions