Open chiranSachintha opened 3 years ago
The general philosophy is that the only kind of shadowing allowed is for a local variable to shadow a global variable. So I would say this should not be valid.
The first is invalid right??
Making the 2nd one disallowed would be annoying though.
They're both not valid, because they both have a local shadowing a local. I don't see any difference. (In the program 1, the k
in the default for l
refers to the k
parameter.)
Description: Do the following programs valid?
Program 1
Program 2