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
In the example described here, it is stated that the below members of B hides the inherited reserved method signatures, and hence declared with new modifier.
And according to the texts described here and here, a warning is to be issued, if the new modifier is not included in the hiding member declaration during hiding.
However, having the new keyword in the above members causes a warning, and declaring the members without the keyword doesn't cause a warning.
The question is that, if the above members hide the inherited reserved method signatures, why does having the new keyword causes a warning? Need help to understand.
Type of issue
Other (describe below)
Description
In the example described here, it is stated that the below members of
B
hides the inherited reserved method signatures, and hence declared withnew
modifier.And according to the texts described here and here, a warning is to be issued, if the
new
modifier is not included in the hiding member declaration during hiding.However, having the
new
keyword in the above members causes a warning, and declaring the members without the keyword doesn't cause a warning.The question is that, if the above members hide the inherited reserved method signatures, why does having the
new
keyword causes a warning? Need help to understand.Page URL
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/classes
Content source URL
https://github.com/dotnet/csharpstandard/blob/draft-v8/standard/classes.md
The text was updated successfully, but these errors were encountered: