-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently to create a struct with certain values used as its fields you need to first default-initialize a new struct, and then assign the field values manually:
struct Foo {
x: int;
y: string;
}
fun main() {
var f: Foo;
f.x = 42;
f.y = "hello";
}
This is quite cumbersome (and even more so in expression contexts), and would be much better handled by a special syntax that fills the fields directly.
The added expression syntax could look like this:
var f = Foo { x: 42, y: "hello" };
Metadata
Metadata
Assignees
Labels
No labels