You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on adding this. A question: can constructor declarations re-provide common keyword parameters given at the datatype level, or do the keywords given on constructors need to be distinct from those given on data types?
I'm currently working under the assumption (which may or may not be correct) that different common parameters can be given on different data declarations for the same datatype, as long as they are consistent (i.e., of the same type) in cases where the same keyword is repeated. I can tighten this up, but I'm not sure how tight we want to make this. We already don't allow keyword parameters on data declarations with no constructors, so we already have a case where different declarations can provide different common keyword parameters.
One obvious thing I could do is check to be sure that the same expression is given as a default for any occurrence of the common keyword parameter, but I'm not sure if this is helpful, and it may not be trivial, depending on how rich the expressions are that can be used as defaults (even if we allow variables, we would need to ensure that all occurrences of the variable are the same variable, so we can't just use a purely syntactic check).
This should now be working. There is one case we are having trouble with -- where the keyword parameters are separated from the others by a comma and where a structured type, using a [ character, is used, the concrete syntax match fails. That isn't directly related to this issue, though, so I'll close it.
The type checker complains about the following:
gives
The text was updated successfully, but these errors were encountered: