4

I am trying to work out why the following line:

let emailQuotation: Expr<LoginView -> string> = <@ fun (v: LoginView) -> v.Email.Text @>

is failing with a compile error, saying "Lookup of object on indeterminate type...". The property ViewModel.Email is a Xamarin Forms Entry, containing a Text property.

What more information does the compiler need, and why is it not able to interpret this expression?

Rob Lyndon
  • 12,089
  • 5
  • 49
  • 74

1 Answers1

1

My solution is ugly. I can do this:

let emailQuotation = <@ fun (v: LoginView) -> let email: Entry = v.Email in email.Text @>

The quotation wasn't able to interpret the type of v.Email. I'm no expert on code quotations, so there may be a way to make the compiler pick up the type in a single expression.

Rob Lyndon
  • 12,089
  • 5
  • 49
  • 74