Open mppf opened 4 years ago
For additional context, some time ago, we decided that default rectangular formal argument intents would be considered generic w.r.t. the actual's domain map in order to support a somewhat common case (a formal that wanted to say something about an array's size, but didn't want to prevent other domain maps / distributions from being passed in). I hadn't realized that the existing support was sensitive to the intents used.
@bradcray mentioned an expectation of a difference between a domain being declared or not:
I believe that if the domain is DR, it’s generic, such that
X: [1..n]
real could accept a block-distributed array over{1..n}
, say. On the other hand, if the formal isX: [D]
real whereD
is a block-distributed domain, it should not be generic, but should literally require an array over that domain (IIRC).
In the following example, a Block-distributed array is passed to an
in
intent arg. The result is compilation error. If thein
intent is removed, the program compiles.This issue is also present with
out
intent arguments after PR #14917.I can't find any information in the language specification about the array-arguments-are-generic behavior so resolving this issue should also update the spec. There is some description here: https://chapel-lang.org/docs/language/spec/arrays.html#array-arguments-to-functions .