fpc/tests/webtbs/tw26481.pp
svenbarth 5115c3e680 Fix for Mantis #26481. This is a regression.
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 -
2015-01-16 16:05:53 +00:00

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.