Variant to TDate (and TTime) assignment does not compiles
Original Reporter info from Mantis: Nicky
-
Reporter name: Nick
Original Reporter info from Mantis: Nicky
- Reporter name: Nick
Description:
It works for TDateTime. But don't works for TDate and TTime.
Steps to reproduce:
procedure Test1(V: Variant);
var
DT: TDateTime; // TDateTime = type Double;
begin
DT := V; //ok
end;
procedure Test2(V: Variant);
var
D: TDate; // TDate = type TDateTime;
begin
D := V; // Error: Incompatible types: got "Variant" expected "TDate"
end;
procedure Test3(V: Variant);
var
T: TTime; // TTime = type TDateTime;
begin
T := V; // Error: Incompatible types: got "Variant" expected "TTime"
end;
procedure Test4(V: Variant);
type
TDateTime = type Double;
var
DT: TDateTime;
begin
DT := V; // Error: Incompatible types: got "Variant" expected "TDateTime"
end;
Mantis conversion info:
- Mantis ID: 29057
- OS: Windows
- OS Build: 7
- Build: RC2
- Platform: x86
- Version: 3.0.0