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
pfgithub opened this issue
Apr 14, 2021
· 0 comments
Labels
acceptedThis proposal is planned.frontendTokenization, parsing, AstGen, Sema, and Liveness.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.
Currently, the same error message is used for declaring a variable twice in the same scope and shadowing a variable from a parent scope
constX=0;
constX=0; // redefinition of 'X'constY=0;
{
constY=0; // redefinition of 'Y'
}
constZ=0;
constDemo=struct {
constZ=0; // redefinition of 'Z'
};
This leads to confusion such as #8522 because the error, especially in structs, makes it sound like the declaration in the inner namespace has somehow ended up in the top level namespace instead of where it actually is.
This could be changed to something like name '…' shadows name from outer scope or something similar to make it clear that the declaration is in the right place and the issue is with name shadowing.
constX=0;
constX=0; // redefinition of 'X'constY=0;
{
constY=0; // name 'Y' shadows name from outer scope
}
constZ=0;
constDemo=struct {
constZ=0; // name 'Z' shadows name from outer scope
};
The text was updated successfully, but these errors were encountered:
andrewrk
added
accepted
This proposal is planned.
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
labels
Apr 15, 2021
acceptedThis proposal is planned.frontendTokenization, parsing, AstGen, Sema, and Liveness.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.
Currently, the same error message is used for declaring a variable twice in the same scope and shadowing a variable from a parent scope
This leads to confusion such as #8522 because the error, especially in structs, makes it sound like the declaration in the inner namespace has somehow ended up in the top level namespace instead of where it actually is.
This could be changed to something like
name '…' shadows name from outer scope
or something similar to make it clear that the declaration is in the right place and the issue is with name shadowing.The text was updated successfully, but these errors were encountered: