Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error of Lookup on object of indeterminate type .... on a already annotated type

Tags:

f#

Why am I getting an error of "Lookup on object of indeterminate type based on information prior to this program point...."

I have already annotated with type information.

It is highlighting the code r.Read().

let rec foldResult myFunc accumulator r:SqlDataReader =
    if r.Read() then
        foldResult myFunc (myFunc 123456 accumulator) r:SqlDataReader
    else
        accumulator
like image 339
JayR Avatar asked Sep 14 '12 00:09

JayR


1 Answers

Put it in parens

let rec foldResult myFunc accumulator (r:SqlDataReader) = ...

Else you're annotating the return type of the function rather than the final parameter type.

like image 168
Brian Avatar answered Oct 14 '22 21:10

Brian