program bug32252; {$MODE DELPHI} {$MACRO ON} {$DEFINE CUSTOM_DICTIONARY_CONSTRAINTS := TKey, TValue, THashFactory} {$DEFINE OPEN_ADDRESSING_CONSTRAINTS := TKey, TValue, THashFactory, TProbeSequence} type // The following types are copied and simplified from Generics.Collections. // They are enough to generate the cycle error. TDummy = class end; TCustomDictionary = class abstract procedure Foo; virtual; abstract; end; TOpenAddressing = class abstract(TCustomDictionary) end; TOpenAddressingLP = class(TOpenAddressing) procedure Bar; virtual; abstract; end; TOpenAddressingLP = class(TOpenAddressingLP); TOpenAddressingLP = class(TOpenAddressingLP); TDictionary = class(TOpenAddressingLP); // This would be a user defined type when using Generics.Collections. // In mode Delphi there is no "specialize" keyword but it makes no difference for the error. TestType = TDictionary; var TestVar: TestType; begin TestVar:=TestType.a{completion:Create;Bar;Foo;TKey;TValue;THashFactory} end.