External Issue: Unexpected compiler error using array.localSlice() on a sliced non-distributed array

19087, "jlbyrne-hpe", "Unexpected compiler error using array.localSlice() on a sliced non-distributed array", "2022-01-24T20:05:26Z"

Using localSlice() on a non-distributed array works, but trying to using it on a slice of the array produces: "error: illegal use of function that does not return a value: 'dsiLocalSlice". This does not happen with slices of distributed arrays.

module Spam {
    use BlockDist;
    use IO;
    use IO.FormattedIO;
    use Reflection;

    proc sliceAndDice(fn: string, line: int, ref arr) throws {
        for l in arr.targetLocales() do on l {
            for d in arr.localSubdomains() {
                ref arrSlice = arr.localSlice(d);
                writeln("%s,%i:%t".format(fn, line, arrSlice));
            }
        }
    }

    proc spamInit() throws {
        const Space = {0..#16};
        var A: [Space] int = Space;
        var distA = newBlockArr(Space, int);
        distA = A;

        sliceAndDice(getRoutineName(), getLineNumber(), A);
        sliceAndDice(getRoutineName(), getLineNumber(), distA);
        sliceAndDice(getRoutineName(), getLineNumber(), distA[0..#8]);
        sliceAndDice(getRoutineName(), getLineNumber(), A[0..#8]);
    }


    proc main() : int {
        try! {
            spamInit();
        }

        return 0;
    }
}

Compile command:
chpl -o spam spam.chpl
spam.chpl:7: In function 'sliceAndDice':
spam.chpl:10: error: illegal use of function that does not return a value: 'dsiLocalSlice'
spam.chpl:25: called as sliceAndDice(fn: string, line: int(64), arr: [domain(1,int(64),false)] int(64))
note: generic instantiations are underlined in the above callstack

Configuration Information

  • Output of chpl --version:
    chpl version 1.25.1
    built with LLVM version 11.0.1
  • Output of $CHPL_HOME/util/printchplenv --anonymize:
    CHPL_TARGET_PLATFORM: linux64
    CHPL_TARGET_COMPILER: clang *
    CHPL_TARGET_ARCH: x86_64
    CHPL_TARGET_CPU: native *
    CHPL_LOCALE_MODEL: flat
    CHPL_COMM: none *
    CHPL_TASKS: qthreads *
    CHPL_LAUNCHER: none
    CHPL_TIMERS: generic
    CHPL_UNWIND: none
    CHPL_MEM: jemalloc *
    CHPL_ATOMICS: cstdlib
    CHPL_GMP: bundled
    CHPL_HWLOC: bundled
    CHPL_RE2: bundled *
    CHPL_LLVM: bundled *
    CHPL_AUX_FILESYS: none