Generic dynamic array Inline specialization issue
Original Reporter info from Mantis: alexvins
-
Reporter name: Alexander Shishkin
Original Reporter info from Mantis: alexvins
- Reporter name: Alexander Shishkin
Description:
Generic dynamic array inline specialization fails inside generic class.
Fortunately not so ugly workaround exists.
Steps to reproduce:
program generictest8;
{mode delphi}{
H+}
{.$DEFINE WORKAROUND}
type
TSimpleHashBucket<T> = record
HashCode : Integer;
Value : T;
end;
TSimpleHashBucketArray<T> = array of TSimpleHashBucket<T>;
TSimpleHash<T> = class
{$IFDEF WORKAROUND}
type
THashBucket = TSimpleHashBucket<T>;
var
FBuckets: array of THashBucket
{$ELSE}
FBuckets : TSimpleHashBucketArray<T>;
{$ENDIF}
end;
var
a: TSimpleHash<Integer>;
b: TSimpleHashBucketArray<Integer>; //this works always
begin
end.
Additional information:
2.7.1 has the bug too.