Open dlongnecke-cray opened 3 years ago
Making the error message better would be simple, and mostly requires distinguishing supported from non-supported cases in https://github.com/chapel-lang/chapel/blob/master/modules/internal/ChapelBase.chpl#L1332-L1353
Supporting other types ought to be as easy as adding casts from strings to those types, I believe? (where maybe the only tricky question would be whether we want casts from strings to those types? Otherwise, we could special-case such types to not use casts).
Yeah I think I should have written "Should" instead of "could", my bad (pun?).
Generally speaking, my philosophy would be to make configs as general-purpose as possible (so "yes it should" barring major challenges that I'm not currently anticipating).
As a Chapel user, I would love for the language to support the use of tuple or range
config
variables (or constants). While writing a test, I found myself expressing the low/high bounds for loops in the following way:I was surprised (after some thought, much less so) to get a compiler error pointing inside internal modules instead:
My hope was that the tuple destructuring would cause
lo
andhi
to be treated as separate variables (that could be configured separately).My first example has complicated semantics. To be thorough, I tried configuring a tuple that was not destructured:
This produced (unsurprisingly, I suppose) the same error.
A similar problem happened when I attempted to configure a range:
Supporting these more complex types would be great, but at the very least I think a clean error message that doesn't point into the guts of
_do_command_line_cast
would be in order.