WLSIMP elides type relevant generators without adding type_conv
Extended Description
This bug is related to 1147.
Consider the following code:
module crud;
export {g};
int[.] g( int[0] a, int[+] b)
{
res = with {
( [0] <= iv < _shape_A_(a)): _sel_VxA_( iv, a);
} : modarray( b);
return res;
}
Despite being empty, the generator conveys the info that res in fact is a vector (int[.]).
Once the empty generator is elided, this info is gone and the type checker complains that it no longer can infer int[.] but reverts to int[+] instead......
Whenever we elide a generator we need to insert a type assertion, i.e.,
rather than replacing the above with
res = with {} : modarry(b);
we need to replace it by
res' = with {} : modarry(b);
res = type_conv( res', int[.]);