fsharp/fsharp — pull request #213 by jack-pappas (2013-12-26 18:13:46+00:00)
Title: Implemented partial support for all array ranks supported by the CLR

I've implemented "partial" support for arrays with ranks 5-32. The reason I've deemed this support "partial" is that it does not implement everything needed for F# code to manipulate these higher-ranked arrays (e.g., getting/storing array elements). However, this code does fix a a bug whereby F# code cannot consume an overloaded constructor or method from a referenced assembly if one or more of the overloads contains one or more parameters whose type is one of these higher-ranked arrays; even if the F# code is calling an overload without any such parameters, the F# compiler emits an error message (FS3138).

After compiling this fix into my local build of the F# compiler, I put together some simple test cases in C# (which I'd be happy to provide if anyone wants), compiled them, and compiled a simple F# project which references the C# assembly and calls some of the overloads which trigger the bug. Compilation succeeded without any issues, and running PEVerify /nologo /verbose against the resulting F# assembly returned no errors or warnings. I also inspected the resulting F# assembly in .NET Reflector and it appears to be compiled correctly.

This pull request is re-implementation of issue #202 for F# 3.1; it also uses maps (actually, arrays) to implement certain parts of the code instead of duplicating functions for each possible array rank.