Adding Operator Overloading and Variable Type + Value Resolution Handlers
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.
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?