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
When declaring a nested type in a subclass that has the same name as a nested type in its superclass, the compiler doesn't warn about shadowing/overriding that name which could create unwanted ambiguity. I think the compiler should warn about that. Imagine the following code:
In that simple example the ambiguity is obvious. In a more complicated code base that could create serious problems. Having the compiler warn or even error at the declaration of Bar.Baz would help preventing that kind of problems.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: edaea98a55a77b81f9acde3ba5640b09
Issue Description:
When declaring a nested type in a subclass that has the same name as a nested type in its superclass, the compiler doesn't warn about shadowing/overriding that name which could create unwanted ambiguity. I think the compiler should warn about that. Imagine the following code:
In that simple example the ambiguity is obvious. In a more complicated code base that could create serious problems. Having the compiler warn or even error at the declaration of Bar.Baz would help preventing that kind of problems.
The text was updated successfully, but these errors were encountered: