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
Is your feature request related to a problem? Please describe.
Because we can't declare the names and types in function types, only on the type signatures of function definitions, the code that uses first class functions does not have access to the keyword parameters feature at all.
The interpreter works anyway because it only warns about additional parameters being provided without stopping execution.
The type checker must provide a critical error since without a declaration no type checking can be done.
This is mostly a grammatical omission. We simply can't type int (int param=...)
Function types can't and shouldn't have default expressions. That is strictly a feature of function and constructor definitions. Otherwise we'd introduce a multiple inheritance situation. By sticking defaults to concrete function definitions each first-class function definition will always have one unique default expression per keyword parameter.
Describe the solution you'd like
Stick as closely as possibly to the syntax of function definitions.
Only put a placeholder like ... or default next to the = sign of the keyword field.
Reuse existing internal types for function in AType and Symbol that already fully support keyword parameters.
Describe alternatives you've considered
Turning the error into a warning; but that can introduce java compilation errors, cast exceptions and NPE's in code generated for "correct" rascal programs
Additional context
This is very relevant for typepal and the rascal typechecking which both use first class functions a lot as members of data constructors.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Because we can't declare the names and types in function types, only on the type signatures of function definitions, the code that uses first class functions does not have access to the keyword parameters feature at all.
int (int param=...)
Describe the solution you'd like
...
ordefault
next to the=
sign of the keyword field.Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: