Type checker: Improve diagnostics for bad arguments to varargs.
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=6064
Reported by @grubba
From the Pike mailinglist (12575/LysLysKOM 19260004):
Pike v7.9 release 5 running Hilfe v3.5 (Incremental Pike Frontend)
> array a = ({});
> mapping m = ([]);
> a+m;
Compiler Error: 1: Too few arguments to `+ (got 2).
Compiler Error: 1: Expected: object | mixed.
Compiler Error: 1: Function type:
Compiler Error: 1: Got : scope(0,function((0=multiset), (1=multiset) ... : 0 | 1) | function((0=mapping), (1=mapping) ... : 0 | 1) | function((0=array), (1=array) ... : 0 | 1) | function(int, int ... : int) | !function(!string ... : mixed) & function(string | int | float, string | int | float ... : string) | !function(!float ... : mixed) & function(int | float, int | float ... : float) | !function(!(object | mixed) ... : mixed) & function(mixed ... : mixed)).
The type checker probably also ought to check if there's any combination of argument types that satisfy the function type, ie in this case suggest that argument 2 ought to be an array.