Replies: 6 comments
-
IL has no concept of custom operators. The |
Beta Was this translation helpful? Give feedback.
-
Oh, nevermind. Reading that again what you're looking for is that convention, at least as it relates to C#. You might want to ask on the VB.NET and F# forums too as their answers will be slightly different. |
Beta Was this translation helpful? Give feedback.
-
The ECMA CLI spec does contain informative mapping between operator names and C++ operators, in §I.10.3 Operator overloading. Those C++ operators are largely the same as C# operators, but I understand if that's not good enough for you. Maybe this shouldn't be part of the C# spec, but it could be part of Roslyn's documentation? |
Beta Was this translation helpful? Give feedback.
-
This might help: http://source.roslyn.io/#Microsoft.CodeAnalysis/Symbols/WellKnownMemberNames.cs,6d17843a3c182cb7 |
Beta Was this translation helpful? Give feedback.
-
IL doesn't, but the runtime spec (ECMA 335) does. It actually defines a number of "well-defined names". Most of which are supported by C#, but several of which (such as |
Beta Was this translation helpful? Give feedback.
-
Reviewed, and not moving to dotnet/csharpstandard. This shouldn't be part of the language standard, but should be documented elsewhere. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Best I can tell, the C# language spec doesn't specify how custom operators are translated to and from IL.
I wanted an exhaustive list of all specially-recognized operator method names (e.g.
op_Modulus
). The only place anyop_*
names show up in the spec is in explaining how to target operators in doc comments.Beta Was this translation helpful? Give feedback.
All reactions