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
Zig supports type inference for function parameters:
fntriple(x: var) @TypeOf(x) {
return3*x;
}
However, reusing var for this purpose feels a bit strange, sice it usually marks mutable variables, which have pretty much nothing to do with type inference. I think it would be clearer to just introduce a new keyword:
fntriple(x: infer) @TypeOf(x) {
return3*x;
}
The text was updated successfully, but these errors were encountered:
[ Bikeshedding Alert ]
Zig supports type inference for function parameters:
However, reusing
var
for this purpose feels a bit strange, sice it usually marks mutable variables, which have pretty much nothing to do with type inference. I think it would be clearer to just introduce a new keyword:The text was updated successfully, but these errors were encountered: