-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Description
Proposed syntax:
fn foo(a: u8, b: usize, c: []const u8) void {}
test "optional argument names" {
foo(c: "Hi!", 0, 42); // -> foo(0, 42, "Hi!");
foo(a: 0, c: "bar", 10); // -> foo(0, 10, "bar");
}
Invalid argument names obviously cause a compile error.
To match the arguments, we simply look at the named arguments first, then match the rest in the same order they appear in the function definition.
floooh and bronze1man
Metadata
Metadata
Assignees
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.