vimeo/psalm

wrong template detection in composed instance

開放

#6,957 建立於 2021年11月22日

 (2 則留言) (0 個反應) (0 位負責人)PHP (668 個分叉)batch import
Help wantedtemplatestype providers

倉庫指標

星標
 (5,369 顆星)
PR 合併指標
 (平均合併 3天 12小時) (30 天內合併 5 個 PR)

描述

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

貢獻者指南