Search error on an object of an unspecified type .... by an already annotated type

Why do I get the error message "Search for an object of indefinite type based on information up to this point in the program ..."

I already annotated type information.

It allocates the r.Read() code.

 let rec foldResult myFunc accumulator r:SqlDataReader = if r.Read() then foldResult myFunc (myFunc 123456 accumulator) r:SqlDataReader else accumulator 
+7
source share
1 answer

Put it in parens

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

In addition, you annotate the return type of the function, not the final type of the parameter.

+16
source

All Articles