Skip to content

Add support for shimming operators #31

@Miista

Description

@Miista

Implicit vs. explicit operators.

Confirm by trying it out in the sandbox.

Currently not supported. Will be added in this issue and linked PR #33

Tasks

  • Implement support for conversion operators (both implicit and explicit)
  • Implement support for arithmetic operators
  • Implement support for equality operators
  • Implement support for comparison operators

Tests

For all of the following operators we need:

  1. Shim tests
  2. Exercise tests
  • Conversion operators
  • Arithmetic operators
  • Equality operators
  • Comparison operators

The list of operators (and their names) is taken from here: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/operator-overloading#overloadable-operators

Operators to support

Arithmetic

  • +x
  • -x
  • !x
  • ~x
  • ++
  • --
  • true I cannot find a good way to express this operation in an expression tree.
  • false I cannot find a good way to express this operation in an expression tree.
  • x + y
  • x - y
  • x / y
  • x % y
  • x & y
  • x | y
  • x ^ y
  • x << y
  • x >> y
  • x >>> y Expression trees cannot contain this operator. This is a limitation on the part of the compiler.

Equality

  • x == y
  • x != y

Comparison

  • x < y
  • x > y
  • x <= y
  • x >= y

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is neededpriority: mediumThe issue has medium priority

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions