v
v copied to clipboard
constant name and variable name declaration ambiguity
Compiler must not allow const and var names to be same or if const and var can have same name, a way to explicitly mention a const name should be allowed? ( example: const.AGE ? ).
The following program prints output: Age=20 AGE=30
AGE is a const name as well as a var name.
Program:
const (
AGE = 40
)
fn main() {
Age := 20
AGE := 30
println('Age=$Age')
println('AGE=$AGE')
}
Related: #265
We'll use the other issue. By the way, we changed the way constants need to be capitalized. We now use PascalCasing.