vimeo/psalm

intersection types and conditional types

Open

#6,942 opened on Nov 18, 2021

View on GitHub
 (18 comments) (0 reactions) (0 assignees)PHP (668 forks)batch import
Help wantedenhancementparser

Repository metrics

Stars
 (5,369 stars)
PR merge metrics
 (Avg merge 3d 12h) (5 merged PRs in 30d)

Description

consider https://psalm.dev/r/8e871b2851

two things:

  • the parser forces me to use parentheses around the intersection type. I would not expect that to be needed
  • since from the condition we know that A is an array, I don't see why A&array should be forbidden

Contributor guide