Consider inline functions of extern class when unifying call parameters

See #2652. I'm not sure this is the right fix, so please review.