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
fn f(a: f32) -> f32 {
// This should treat 'a' as if it were a const declaration, where its value is taken to be the argument value provided
// at runtime by the caller.
// In particular, you assign to 'a'.
var b : f32 = a; // this is fine
a = 12.0; /// this should be invalid.
return a;
}
One reason this is required is that we need to support formal arguments that are pointers. But a pointer is not storable, and so it can't go into a 'var'. But a const can hold a pointer value.