#205·assert

implementsInterface does not pass psalm validation when passed an object

Author: githooberCreated Jun 26, 2020Updated Jan 25, 2022

The snippet below mimics the logic from implementsInterface https://psalm.dev/r/9362046866

With an object passed to implementsInterface Assert produces the following error:

ERROR: TypeDoesNotContainType - 33:1 - Cannot resolve types for $a - A does not contain class-string<ExpectedType:fn-implementsinterface as I>

With a call get_class on the object, psalm validation passes.