Any idea what the workaround is please? I hit that error in the following.
proc set(out x : [?D] ?R, y : [D] R)
{
param two = 2:R;
const (_nx, _ny) = D.dims();
const (nx, ny) = (_nx.high, _ny.high);
forall i in 1 .. nx do
{
for j in 1 .. ny do
{
x[i, j] = (i + j * two):R;
y[i, j] = (i * two + j):R;
}
}
}
proc main
{
param useSet = false;
type R = real(32);
var x, y : [1..10, 1..10] R;
param two = 2:R;
set(x, y);
/* this works by the way
{
const (_nx, _ny) = x.domain.dims();
const (nx, ny) = (_nx.high, _ny.high);
forall i in 1 .. nx do
{
for j in 1 .. ny do
{
x[i, j] = (i + j * two):R;
y[i, j] = (i * two + j):R;
}
}
}
*/
// sum
{
var s = 0.0;
for tx in x do s += tx;
for ty in y do s += ty;
writeln(s);
}
{
const x : [1..3] R = [ 1:R, 2:R, 3:R ];
const y : [6..8] R = [ 100:R, 200:R, 300:R ];
writeln(x + y);
}
}