mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 01:22:41 +02:00

nutils.pas, handle_staticfield_access: * generics don't have staticvarsyms for their static fieldvarsyms so we need to simulate a non-static access to avoid 1) an exception and 2) incorrect errors that instance methods can't be accessed + added tests git-svn-id: trunk@29484 -
34 lines
729 B
ObjectPascal
34 lines
729 B
ObjectPascal
{ %NORUN }
|
|
|
|
program tw26481;
|
|
|
|
{$MODE DELPHI}
|
|
|
|
type
|
|
IComparer<T> = interface
|
|
function Compare(constref Left, Right: T): Integer; overload;
|
|
end;
|
|
|
|
TOrdinalComparer<T, THashFactory> = class(TInterfacedObject, IComparer<T>)
|
|
protected class var
|
|
FComparer: IComparer<T>;
|
|
FTest: TClass;
|
|
public
|
|
function Compare(constref Left, Right: T): Integer; virtual; abstract;
|
|
end;
|
|
|
|
TGOrdinalStringComparer<T, THashFactory> = class(TOrdinalComparer<T, THashFactory>)
|
|
public
|
|
function Compare(constref ALeft, ARight: T): Integer; override;
|
|
end;
|
|
|
|
function TGOrdinalStringComparer<THashFactory, T>.Compare(constref ALeft,
|
|
ARight: T): Integer;
|
|
begin
|
|
Result := FComparer.Compare(ALeft, ARight);
|
|
end;
|
|
|
|
begin
|
|
end.
|
|
|