100 Days Of Solidity, Shadowing State Variables, Inherited State Variables, Learn Solidity.
Solidity 0.6 and Earlier: Prior to Solidity version 0.6, shadowing was disallowed. If you attempted to shadow a state variable by re-declaring it in a child contract, you would encounter a compilation error. This restriction was implemented to maintain consistency and prevent confusion. Correctly