The special names op_Exponent and op_Exponentiation are not reserved for interop.
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- documentation
Research direction
Start in standard/classes.md at §15.3.10.6, then compare the reserved-name references in the linked Roslyn and System.Linq.Expressions sources. Update the standard to include op_Exponent as reserved for operators, and confirm the wording covers the behavior described by the example.
Written by the indexing model from the issue text.
Description
Describe the bug
The special name op_Exponent is not reserved for interop, although Roslyn reserves and uses it.
https://github.com/dotnet/roslyn/blob/main/src/Compilers/Core/Portable/Symbols/WellKnownMemberNames.cs
The name is also recognized by System.Linq.Expressions along with op_Exponentiation.
It is missing from section §15.3.10.6 "Method names reserved for operators".
- https://github.com/dotnet/csharpstandard/blob/draft-v8/standard/classes.md#153106-method-names-reserved-for-operators
- https://github.com/dotnet/csharpstandard/blob/draft-v9/standard/classes.md#153106-method-names-reserved-for-operators
Example
Provide an example that shows the problem in the standard. A small code snippet that should be allowed or disallowed, or code that behaves differently than the standard.
void Main()
{
var x = new HasExponent();
var constant = Expression.Constant(x);
var exponent = Expression.Power(constant, constant);
Console.WriteLine(exponent.Method.Name);
}
class HasExponent
{
[SpecialName]
public static HasExponent op_Exponent(HasExponent left, HasExponent right) => new HasExponent();
}
Expected behavior
What should the standard declare differently?
Include op_Exponent as reserved.
Additional context
System.Linq.Expressions: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs#L2756
- Dominant language
- C#
- Stars
- 815
- Forks
- 99
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/csharpstandard
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dotnet/csharpstandard#1629 ·
-
type: clarity
Difficulty 1/5 Under an hour Newbie friendliness 82/100
dotnet/csharpstandard#599 ·
-
9.3.6 Char set Opentype: clarity
Difficulty 1/5 Under an hour Newbie friendliness 68/100
dotnet/csharpstandard#189 · 5 comments ·
-
dotnet/csharpstandard#1805 · 1 assignee ·
-
dotnet/csharpstandard#1803 · 2 comments · 1 assignee ·
All issues in dotnet/csharpstandard
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·