View Issue Details

IDProjectCategoryView StatusLast Update
0029057FPCCompilerpublic2019-11-04 11:50
ReporterNickAssigned ToMarco van de Voort 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Platformx86OSWindowsOS Version7
Product Version3.0.0Product BuildRC2 
Target VersionFixed in Version 
Summary0029057: Variant to TDate (and TTime) assignment does not compiles
DescriptionIt works for TDateTime. But don't works for TDate and TTime.
Steps To Reproduceprocedure 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;
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Activities

Marco van de Voort

2017-05-07 16:03

manager   ~0100142

Last edited: 2017-05-07 16:04

View 2 revisions

Isn't this what is expected? With righthand TYPE you create a new type definition, incompatible with other definitions.

Variant only supports TDateTime, so TDate and TTime need typecasts?

Marco van de Voort

2019-06-02 18:13

manager   ~0116535

See above

Marco van de Voort

2019-11-04 11:50

manager   ~0119045

No feedback. If you have more info please reopen

Issue History

Date Modified Username Field Change
2015-11-20 23:38 Nick New Issue
2017-05-07 16:03 Marco van de Voort Note Added: 0100142
2017-05-07 16:04 Marco van de Voort Note Edited: 0100142 View Revisions
2019-06-02 18:13 Marco van de Voort Assigned To => Marco van de Voort
2019-06-02 18:13 Marco van de Voort Status new => feedback
2019-06-02 18:13 Marco van de Voort FPCTarget => -
2019-06-02 18:13 Marco van de Voort Note Added: 0116535
2019-11-04 11:50 Marco van de Voort Status feedback => resolved
2019-11-04 11:50 Marco van de Voort Resolution open => no change required
2019-11-04 11:50 Marco van de Voort Note Added: 0119045