-
Notifications
You must be signed in to change notification settings - Fork 90
Description
Type providers must generate quotations for the target context of referenced assemblies in order to hand these to the F# compiler. This is done by the TPSDK, taking design-time quotations to target quotations.
This approach is entirely reasonable. However, it hits limitations in the F# quotations library in FSharp.Core where FSharp.Core.Quotations is overly stringent in the checks it applies, forcing some (but not all) quotations to be design-time quotations. For example, when you call Expr.Lambda, FSharp.Core forces this to be for the design time type FSharpFunc rather than any FSharpFunc in the target assemblies.
As a result, we use a set of hacks into FSharp.Core to make "unchecked" quotations.
We should urgently remove the need for this hack by making an improvement to FSharp.Core, to to either
-
Have FSharp.Core allow "unchecked" quotations to be created, where the checks are simply skipped, OR
-
Have FSharp.Core make the checks to be with respect to a set of target assemblies
The first is easier. I'll create a corresponding issue in Microsoft/visualfsharp since the change really needs to be made there.