External Issue: uint(8) range with int stride leads to amgibuity error instead of descriptive error

20034, "cassella", "uint(8) range with int stride leads to amgibuity error instead of descriptive error", "2022-06-17T14:23:16Z"

Summary of Problem

This program gets an ambiguity error in module code instead of a more descriptive error that is available.

Steps to Reproduce

Source Code:

config var l = 0:uint(8), u = 10:uint(8), s = -1;

for i in l..u by s do writeln(i);

Compile command:

chpl bar.chpl
bar.chpl:1: In module 'bar':
bar.chpl:3: error: ambiguous call 'chpl_direct_range_iter(uint(8), uint(8), int(64))'
$CHPL_HOME/modules/internal/ChapelRange.chpl:2041: note: candidates are: chpl_direct_range_iter(low: uint(8), high: uint(8), stride: int(64)) [1322283]
$CHPL_HOME/modules/internal/ChapelRange.chpl:1951: note:                 chpl_direct_range_iter(low: int(64), high: int(64), stride: int(64)) [433391]
$CHPL_HOME/modules/internal/ChapelRange.chpl:1956: note:                 chpl_direct_range_iter(low: uint(64), high: uint(64), stride: int(64)) [433667]
$CHPL_HOME/modules/internal/ChapelRange.chpl:2028: note:                 chpl_direct_range_iter(low: int(16), high: int(16), stride: int(64)) [1322300]
$CHPL_HOME/modules/internal/ChapelRange.chpl:2028: note:                 chpl_direct_range_iter(low: int(32), high: int(32), stride: int(64)) [1322317]
$CHPL_HOME/modules/internal/ChapelRange.chpl:2028: note:                 chpl_direct_range_iter(low: int(64), high: int(64), stride: int(64)) [1085787]
$CHPL_HOME/modules/internal/ChapelRange.chpl:2034: note:                 chpl_direct_range_iter(low: uint(8), high: uint(8), stride: int(64)) [1322334]
$CHPL_HOME/modules/internal/ChapelRange.chpl:2034: note:                 chpl_direct_range_iter(low: uint(16), high: uint(16), stride: int(64)) [1322351]
$CHPL_HOME/modules/internal/ChapelRange.chpl:2034: note:                 chpl_direct_range_iter(low: uint(32), high: uint(32), stride: int(64)) [1322368]
$CHPL_HOME/modules/internal/ChapelRange.chpl:2034: note:                 chpl_direct_range_iter(low: uint(64), high: uint(64), stride: int(64)) [1322385]
bar.chpl:3: note: unresolved call had id 179257

Using a different range syntax (that I didn't record last night) I had gotten this error, which I think should be the error produced by the above case too:

$CHPL_HOME/modules/internal/ChapelRange.chpl:1500: In function 'chpl_by':
$CHPL_HOME/modules/internal/ChapelRange.chpl:1501: error: can't apply 'by' to a range with idxType uint(8) using a step of type int(64)

Associated Future Test(s):

None yet

Configuration Information

chpl version 1.27.0 pre-release (a83c3886e4)

CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: gnu
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native *
CHPL_LOCALE_MODEL: flat
CHPL_COMM: gasnet *
  CHPL_COMM_SUBSTRATE: udp
  CHPL_GASNET_SEGMENT: everything
CHPL_TASKS: qthreads
CHPL_LAUNCHER: amudprun
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
  CHPL_NETWORK_ATOMICS: none
CHPL_GMP: none
CHPL_HWLOC: bundled
CHPL_RE2: bundled
CHPL_LLVM: none *
CHPL_AUX_FILESYS: none

gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0