I suggest we ...

Extend the set of expressions supported in provided methods

There are some (undocumented) constraints on what kinds of quotations can be returned by a type provider's GetInvokerExpression method. In some cases (e.g. the lack of support for PropertyGet nodes) these missing expression cases have been papered over in the ProvidedTypes wrapper by translation to supported equivalents (e.g. MethodCall).

However, for some other cases (e.g. FieldGet, FieldSet) there is no reasonable translation to supported equivalents, and for others (e.g. LetRecursive) there's only an awkward translation that is much less efficient than a real implementation would be.

Even in the cases where there is a reasonable translation (like PropertyGet mentioned above), it seems like it would make sense for the compiler to support the expression forms directly - at the moment the set of supported expressions seems ad hoc.

5 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Keith Battocchi shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Don Syme commented  ·   ·  Flag as inappropriate

        We may move to a model where the low-level ITypeProvider interface doesn't actually use quotations, but rather some representation of code which is independent of System.Type (and actually simpler because of that). That would be a good time to revisit this. Until then I'm going to leave things as they are and close this one as part of bookkeeping, thanks

      F# Language

      Feedback and Knowledge Base