Delphi does not infer TDateTime for local variables

133 Views Asked by At

I have a routine that fetches a TDateTime from a database. I fetch it like this in another routine:

var lCrmStartDate := self.GetCrmStartDate;

This results in lCrmStartDate being inferred as Extended, giving me all sorts of trouble.

I now fetch the date like so:

var lCrmStartDate : TDateTime := self.GetCrmStartDate;

and that works fine.

Can someone explain to me why the compiler infers Extended instead of TDateTime (which is the return type for GetCrmStartDate())?

0

There are 0 best solutions below