chapel icon indicating copy to clipboard operation
chapel copied to clipboard

Better error message for RectangularDomain.sorted()

Open jabraham17 opened this issue 9 months ago • 5 comments

Currently we have the .sorted method on domains. It is only intended to work on associative domains, although its documentation does not indicate this. However, should a user try to use .sorted on a rectangular domain they get a confusing error from an internal module.

var d = {1..10};
var s = d.sorted(); // error: unresolved call 'unmanaged domain(1,int(64),one).dsiSorted(DefaultComparator)'
writeln(s);

This contrasts with other non rectangular domain methods like bulkAdd

var d = {1..10};
d.bulkAdd([1,2]); // error: incompatible argument(s) or this domain type does not support 'bulkAdd'

We should have a better error message for .sorted, possibly implemented as an error overload in ChapelDomain.chpl

jabraham17 avatar May 24 '24 14:05 jabraham17