未验证 提交 f802821b 编写于 作者: Y Youssef Victor 提交者: GitHub

Update Clashing Enum Members.md (#46816)

上级 0bd72a7c
Clashing Enum Members Clashing Enum Members
===================== =====================
As reported in #2909, it is possible to reference an enumeration type from VB that contains more than one enumeration member with the same name. For example, a library author might release version 1 of his API in C# with this type As reported in [#2909](https://github.com/dotnet/roslyn/issues/2909), it is possible to reference an enumeration type from VB that contains more than one enumeration member with the same name. For example, a library author might release version 1 of his API in C# with this type
```cs ```cs
enum Something enum Something
{ {
Something, Something,
Datetime, Datetime,
SomethingElse, SomethingElse,
} }
``` ```
and then realize later that the name Datetime is misspelled (it should be camel-case, with `Time` capitalized). So in version 2 the type is changed and then realize later that the name Datetime is misspelled (it should be PascalCase, with `Time` capitalized). So in version 2 the type is changed
```cs ```cs
enum SomeEnum enum SomeEnum
{ {
Something, Something,
DateTime, DateTime,
[Obsolete] Datetime = DateTime, [Obsolete] Datetime = DateTime,
SomethingElse, SomethingElse,
} }
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册