-
Notifications
You must be signed in to change notification settings - Fork 1.7k
numeric type mismatch #12542
Copy link
Copy link
Open
Labels
needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area ownersAn area label is needed to ensure this gets routed to the appropriate area ownersuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Metadata
Metadata
Assignees
Labels
needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area ownersAn area label is needed to ensure this gets routed to the appropriate area ownersuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
🔖 Ready
Type of issue
Other (describe below)
Description
C# code example defines
enum SingleHue : short
enum MultipleHue : short
but the loop variable is of type int. AFAIK the compiler/JIT will have to enlarge before any bit operation and that is a perf no-no
no advantage reason given why code should be based on short, so I suggest you either use matching int (or better just omit and let compiler choose)
BTW this code shows all of C#, F# and VB language examples, whereas imho devs are likely to focus on just ONE.
Elsewhere in the docs the UX offers a combo to display lang of choice (to reduce clutter and brain-fade). TIA !
Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute.-ctor?view=net-10.0&devlangs=csharp&f1url=%3FappId%3DDev18IDEF1%26l%3DEN-US%26k%3Dk%28System.FlagsAttribute.%23ctor%29%3Bk%28DevLang-csharp%29%26rd%3Dtrue
Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System/FlagsAttribute.xml
Document Version Independent Id
4c34e6ce-3163-99f4-3d05-251583b8a874
Platform Id
83a0548e-26e2-3231-958d-bfbb757475a1
Article author
@dotnet-bot