You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would be nice to have in the runtime, to be able to refine is an is like way, instead of an as like way. \Facebook\TypeSpec\classname(IFace::class)->assertType($some_classname) is what you can do today.
Maybe $x is IFace::class could be taught to perform this trick.
This could not have been possible with the old instanceof operator, since that would allow a stringname of a class on the RHS, which would have made checks for classname<T> and T ambiguous.
The repro would never work though, since the typechecker does not understand that all elements of $classes meet the predicate, since it does not understand \ConstCollection::filter().
eg:
The text was updated successfully, but these errors were encountered: