Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

Adding Operator Overloading and Variable Type + Value Resolution Handlers #16

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

mdemars
Copy link

@mdemars mdemars commented Mar 11, 2015

Hi,

I'm interested in using Expressions in a project i'm working on.
There are 2 features which I need:

  • Resolve operators in a base-class
  • Be able to provide variable types and values at run-time (which was a feature of Flee).

I've implemented both of these in this pull request. They pass all tests (except the one which is known to fail of course).

NOTE: 2 things which are not super clean in my commits are the naming of unit tests and the ignoring of the CSharpLexer.

@pvginkel
Copy link
Owner

Thank you for your pull requests. There are however a few remarks I'd like to make.

First I've refactored the new events a bit. They now follow the standard .NET event handler pattern. I've also changed the way the type resolver is passed to the resolver. Instead of passing the event I now pass an IVariableTypeResolver that calls back into the context.

I've also reworked FindCommonType to not create lists but work directly with the type hierarchy. I've reworked GetTypeHierarchy to create the full list for both the left and right types. It just creates the single list now removing the need for the Distinct method. The IsOperatorOverloaded also doesn't use the GetTypeHierarchy anymore and instead works with the Type hierarchy directly.

On issue that is still open is that there are failing unit tests, specifically TestOverloadResolution. With me it already fails at "valuetype2(100)".

You can pull these from my operator-overloading branch. Can you please have a look at these changes and fix the failing unit test?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants