vimeo/psalm

wrong template detection in composed instance

Offen

#6.957 geöffnet am 22.11.2021

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)PHP (668 Forks)batch import
Help wantedtemplatestype providers

Repository-Metriken

Stars
 (5.369 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 3T 12h) (5 gemergte PRs in 30 T)

Beschreibung

Consider this snippet of code https://psalm.dev/r/6731c85f04

Given an object of type Iso<S, A>, its to method should be a function from S to A.

Passing an object $that of type Iso<A, C> as a parameter to a method of the ISO<S, A> object and checking the type of its to method, I would expect to get callable(A): C. Instead I get a callable(S): A. This is weird because $that doesn't know anything about the S template

Contributor Guide