When is a bigint not a bigint, sequential reduce issue

I have the code fragment:

const one = new bigint(1);
…
proc reductive_sequential(n: bigint): bigint {
  assert(n >= 0);
  return * reduce for i in one..n do i;
}

in the file src/factorial.chpl. Line 43 is the return statement of the procedure. On compilation, I get:

chpl -o factorial_test --main-module factorial_test src/factorial.chpl test/factorial_test.chpl
src/factorial.chpl:41: In function 'reductive_sequential':
src/factorial.chpl:43: error: Bounds of 'low..high' must be integers of compatible types.

which is a bit surprising. I am fairly sure this code has compiled OK in the past, with a compiler prior to 1.22.1.

Hi Russel —

Unfortunately, ranges of bigint are not yet supported, and this error message’s choice of wording is poor, so doesn’t make that clear.

At some point, I had a branch that got us 95% to the way of having bigint ranges working, but before I got the final 5% done, I got distracted by other things and have never gotten back to it. It would be interesting to try again today and see if it worked better. I think I may have had you testing a version of that branch at some point, which may be why you thought this had been supported in the past (?).

Sorry that we haven’t added this yet… it’s slipped out of my mind for most of the past year (but this is a good reminder),
-Brad

1 Like

I appear to have forgotten a lot of things I was trying when I was last playing with Chapel! :wink:

You’re not alone! I went pretty far with trying to compile versions of your test before remembering the state of things myself.

1 Like