// alternates of the method until we find one that
// takes the correct types
$alternate_parameter=null;
$alternate_parameter_type=null;// TODO: Properly merge "possibly undefined" union types - without this, undefined is inferred instead of possibly undefined
// See if the argument can be cast to the parameter.
// TODO: In order for intersection types to work (e.g. casting ArrayObject to ArrayAccess&Countable),
// the codebase must be passed into canCastToUnionType (instead of expanding types), because ArrayAccess|Countable is not a type that casts to ArrayAccess&Countable