Is this a bug in generics with default()?

=====================

type
  TEnum = (Unused = '.');
  generic TSomething<T> = class
    function Get: T;
  end; 
  TEnumeratedSomething = specialize TSomething<TEnum>;

function TSomething.Get: T;
begin
  // Range check error while evaluating constants (0 must be between 46 and 46)
  exit(Default(T));
end;


Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to