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
contractTest {
function f(intb) private{
uint b =0;
}
}
I expected to see this happen: The variable b defined inside the function body should be able to override the function parameter name, similar to the behavior in solc.
Instead, this happened: Solar threw an error message: error: identifier b already declared.
I think you mean "It is not possible to define a variable with the same name as the parameter"
lum7na
changed the title
It is not possible to define a function with the same name as the parameter
It is not possible to define a variable with the same name as the parameter
Feb 11, 2025
I tried this code:
I expected to see this happen: The variable
b
defined inside the function body should be able to override the function parameter name, similar to the behavior insolc
.Instead, this happened: Solar threw an error message:
error: identifier b already declared
.Meta
solar --version
:The text was updated successfully, but these errors were encountered: