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
The default value notation (= y) may appear in declarations of struct fields, class fields or function arguments.
The following sections of the language reference should mention the default value notation:
1.6.1.4 Function arguments (under 1.6 optionality):
Alternatively, using the default value notation can be used to allow a parameter not to be assigned
when calling the function. Using a default value in the function declaration ensures that by
always has a value so there is no need to unwrap it (this is why its type is num and not num?):
letincrement=(x: num,by: num=1): num{returnx+by;}
1.7 Type Inference
Function argument type is inferred iff a default value is provided.
The text was updated successfully, but these errors were encountered:
This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days.
Feel free to re-open this issue when there's an update or relevant information to be added.
Thanks!
The default value notation (
= y
) may appear in declarations of struct fields, class fields or function arguments.The following sections of the language reference should mention the default value notation:
Alternatively, using the default value notation can be used to allow a parameter not to be assigned
when calling the function. Using a default value in the function declaration ensures that
by
always has a value so there is no need to unwrap it (this is why its type is
num
and notnum?
):Function argument type is inferred iff a default value is provided.
The text was updated successfully, but these errors were encountered: