chapel
chapel copied to clipboard
Partial instantiations should not allow overriding of instantiated fields via named arguments
Consider the following program:
record pair { type fst; type snd; }
type x = pair(int, ?);
type y = x(fst=bool);
writeln(y : string); // produces pair(bool)
x is a pair(int, ?), but y is a pair(bool, ?). This, to me, is not consistent with the original intent of partial instantiations (the ability to incrementally build a generic type), and is potentially confusing.
We should make this an error and inform the user that the field fst is already instantiated.
This came up in #27861 where the current behavior was replicated in dyno. If we decide to change this in the future, it will be much easier to do so in dyno where the behavior is clearly identified.