You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
dsyme
changed the title
Short term aim: Remove use of reflection to create target quotations
Long term aim: Remove use of reflection to create target quotations
Sep 21, 2021
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 typeFSharpFunc
rather than anyFSharpFunc
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.
The text was updated successfully, but these errors were encountered: