Attributes: Internal error 2019070601
Original Reporter info from Mantis: Thaddy
-
Reporter name: Thaddy de Koning
Original Reporter info from Mantis: Thaddy
- Reporter name: Thaddy de Koning
Description:
While testing the new attributes feature I ran into Internal error 2019070601
There maybe something wrong with my assumptions (see code below) since I am not yet experienced enough with this feature, but it should not throw an internal error.
Steps to reproduce:
program testattributes;
{$mode delphi}{$warn 5079 off} // turn warning experimental off
uses
sysutils, dateutils, typinfo, rtti, classes;
type
{$M+}
TDateTimeAttribute = class(TCustomAttribute)
private
FArg:TDateTime;
public
constructor Create(aArg: String);overload;
constructor Create(aArg: TDateTime);overload;
constructor Create(aArg: int64);overload;
property DateTime:TDateTime read Farg;
end;
[TDateTimeAttribute]
TMyDateTimeClass = class
private
FDateTime:TDateTime;
published
[TDateTimeAttribute(Now)]
property DateTime:TDateTime;
end;
constructor TDateTimeAttribute.Create(aArg: String);
begin
inherited create;
FArg := StrToDateTime(aArg);
end;
constructor TDateTimeAttribute.Create(aArg: TDateTime);
begin
FArg := aArg;
end;
constructor TDateTimeAttribute.Create(aArg: int64);
begin
FArg := UnixToDateTime(aArg);
end;
var
Test:TMyDateTimeClass;
begin
Test := TMyDateTimeClass.Create;
try
writeln(DateTimeToStr(Test.DateTime));
finally
test.free;
end;
end.
Additional information:
I was trying to unify datetime initialization.
Mantis conversion info:
- Mantis ID: 35866
- OS: Raspbian
- OS Build: Stretch
- Build: 42454
- Platform: armhf
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 42469 (#6cde8ab4)