F # Quotation Creating a very strange compilation error

I am trying to find out why the following line:

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

does not work with a compilation error, saying "Search for an object by an undefined type ...". The property ViewModel.Emailis Xamarin Forms Entry, which contains the property Text.

What other information does the compiler need and why cannot it interpret this expression?

+4
source share
1 answer

My decision is ugly. I can do it:

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

The quote could not interpret the type v.Email. I'm not an expert on code quotes, so there may be a way to get the compiler to select a type in a single expression.

+1
source

Source: https://habr.com/ru/post/1649813/


All Articles