This initial commit only handles the trivial case where an Index or Range object is constructed.
The TODO portions of the test case show there are plenty of cases where where the C# compiler emits more complex code patterns that will require ILAst transforms.
Remove the committed .il files: these were originally intended to prevent test failures due to differences in the C# compiler on the system.
But legacy csc stopped changing long ago; and roslyn is tested via NuGet package, so everyone is using the same version.
Interestingly enough, avoiding the roundtrip through ildasm/ilasm caused some test failures due to changes in the order of top-level types.
So I've started sorting the types by name to ensure consistency in the tests. This required adjusting some existing tests.
* remove redundant casts on yield-return-expression
* keep variable name from metadata for foreach loops
* fix 'yield break;' in nested try-finally sometimes causing a decompiler error
This is a work-in-progress; ILSpy is not functional with this commit.
The old code path still exists but is broken because some classes were modified for the new system.
The new system is still highly incomplete (types only have fields, but no methods).
* Use tuple literals instead of calling 'new ValueTuple<..>' constructor
* Where available, use element names for field access
* Make CallBuilder aware of tuple-name/dynamic type erasure, to avoid introducing casts when the types differ only in the tuple element names.
* Make CallBuilder provide a ResolveResult with the correct C# return type for the resulting expression.
Previously we were using the type-erased return type from the IL.
* Fix a bug that caused us to introduce returning casts when accessing an indexer.