Hacker News new | ask | show | jobs
by flohofwoe 590 days ago
In many situations the compiler can infer the type:

    fn my_func(): MyType {
        return .{ ... };
    }
The dot is just the placeholder for the inferred type and the above is equivalent with:

    fn my_func(): MyType {
        return MyType{ ... };
    }
...and Zig allows to write that verbose form too if you prefer that.