Reusing parameter in type pattern leads to compiler error.
This code fails with the error "Assertion "num_rets > 0" failed at /.../sac2c/src/libsac2c/typecheck/type_errors.c:1816 -- expected at least one return value"
int main() {
return 0;
}
// This does not work
void compare(int m, float[m] a)
{
m = 10;
}
// This does work
void compare(int n, float[m] a)
{
m = 10;
}
These also do not work and seem related:
void compare(int m, float[am] a) | am == m
{
print("test");
}
void compare(int m, float[am] a) | check(m,am)
{
print("test");
}
bool check(int a, int b) {
return a == b;
}
Tested on release sac2c 1.3.3-MijasCosta-1187-gd6b95 and 1.3.3-MijasCosta-1165