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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With