partially applied fold and type pattern check fails
When compiling
int minIdx (int[n] a, int i, int j)
{
return i;
}
int minPos( int[n] x)
{
return with {
([0] <= [i] < [n]) : i;
} : fold (minIdx (x), 0);
}
int main () {
return minPos( [1,2,0,3,4,5]);
}
with sac2c -check p using
sac2c 2.0.0-Tintigny-187-ge8af
build-type: RELEASE
we get
./bug.sac:11:16: error:
10. ([0] <= [i] < [n]) : i;
11. } : fold (minIdx (x), 0);
↑
12.
13. }
No definition found for a function "_MAIN::minIdx" that expects 2
arguments
and yields 1 return value
Compilation failed while Converting to static single assignment form, 1 error(s).
When compiling with sac2c all is fine.