fsharp/FSharp.Compiler.Service — pull request #241 by quasilord (2014-10-22 22:46:24+00:00)
Title: add checked expressions to compiler API

For an analysis project we need the ability to access the checked expressions beyond what quotations offer. This PR adds the ability to access a quotation-like form of checked expressions to the compiler API.

The code is adapted from sreflect.fs and creflect.fs (the compiler code that generates quotation data).

* Expressions are converted then made available as an FSharpExpr object that uses active patterns and the existing symbol types to reveal the contents of expressions.

* There are some differences to the quotation API in the treatment of generics and properties. Since no reflection objects are used, generic instantiations must be made explicit at calls.

* All restrictions of the quotation API are lifted - e.g. expressions can include object expressions.

* Rename FSharpDeclarationSet to FSharpDeclarationListInfo to help clean up in the compiler service API.

* Pattern matching is still eliminated using the same approach as creflect.fs uses for quotations.

* You must specify keepAssemblyContents=true to access any checked expressions.

Some testing included for some of the corner cases. More testing is needed, especially over large things. One ultimate aim is to analyze the F# compiler itself.