microsoft / microsoft/CsWin32

Implement IEqualityOperators for autotypes

Open
#1,639 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
2.5k
Forks
124
Avg merge
1d 3h
Merged PRs (30d)
9

Description

Is your feature request related to a problem? Please describe.

Implement IEqualityOperators when has equality operator. It may be useless but nice to have it. Since standard library has this interface, why not don't implement it?

(Since C# can't quack, it is useful in generic. It will be better to have this.

Describe the solution you'd like

Such as:

partial struct HINSTANCE : System.Numerics.IEqualityOperators<HINSTANCE, HINSTANCE, bool>;

Additional context

It will be better if autotypes can implement every numeric static interface if it has that function.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the source-generator code that creates autotypes and the tests covering generated operator support. Check how equality operators are detected, then determine how the generated declaration should include IEqualityOperators and related numeric static interfaces. Done means eligible autotypes implement the requested interface and the generator tests cover the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.