We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, type deduction only occurs for variable declarations:
let x = 42.0;
is equivalent to
let x: f32 = 42.0;
It would be great to allow type deduction for other cases:
let x: f32; let v = vec3(x, x, x); // no need to write vec3[f32](x, x, x)
Other examples:
let x: mat4[f32]; let y = mat3(x); //< okay, y is a mat3[f32]
let x: f32; let a = array(x, x, x); // a is an array[f32, 3]
const vertPos = array[vec2[f32]]( vec2(-1.0, 1.0), //< no need to write vec2[f32] for every value vec2(-1.0, -3.0), vec2( 3.0, 1.0) );
It should also be pretty easy to add return type deduction (but i'm not sure it should be done):
fn foo() {} //< returns nothing fn bar() { return 42; } //< return i32 fn foobar() { return vec3(1.0, 2.0, 3.0); } //< return vec3[f32]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, type deduction only occurs for variable declarations:
is equivalent to
It would be great to allow type deduction for other cases:
Other examples:
It should also be pretty easy to add return type deduction (but i'm not sure it should be done):
The text was updated successfully, but these errors were encountered: