Hello, Following this article:
http://alex.ciobanu.org/?p=51 The compiler does not check the constructor restriction. Try this test: {$mode delphi} TTest = class private // hidding the constructor to cause a compiler error constructor Create; end; TGen<T: class, constructor> = class end; constructor TTest.Create; begin end; var Gen: TGen<TTest>; begin Gen := TGen<TTest>.Create; end; It compiles well in FPC (from trunk), but the same code in XE is: "[dcc32 Error] Unit1.pas(36): E2513 Type parameter 'T' must have one public parameterless constructor named Create" It is a bug in FPC or I need to enable some directive switch? Thank you! -- Silvio Clécio My public projects - github.com/silvioprog
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal