type pattern that contain + or * do match incorrectly
When compiling
int foo( int[*,n] a)
{
return n;
}
int main()
{
return foo( [[1,2]]);
}
with sac2c -check cp -noprelude tutu2.sac -b2
using sac2c 2.1.0-PuurGeluk-209-ge94f3
we get:
int _tp_foo_impl( int[+] a { ,NN } )
/*
* _tp_foo_impl :: ---
*/
{
n = _sel_VxA_( [ 0 ], _shape_A_( a)) /* no constant offset in dim 1 */;
return( n);
}
which is wrong! For + instead of * that is (and also was prior to MR!612) wrong. MR!612 corrected ATP for d>n:shp pattern and saved var-pattern slightly differently than before but both versions do not handle these cases correctly.
Another example, which I believe to be the same issue, is the take function with the second argument TP being [n:oshp,*] .... So, once the above example is fixed, please check the take variant and, if necessary, raise another issue....