Hello,

in actual trunk - fpc 2.7.1 -  is not possible to do folloving:

unit uStringListHelper;

{$mode delphiunicode}

interface

uses
  Classes, SysUtils;

type

  { TStringListHelper }

  TStringListHelper = class helper for TStringList
  public
    procedure LoadFromFile(const FileName: string; Encoding: TEncoding);
overload;
  end;


implementation

{ TStringListHelper }

procedure TStringListHelper.LoadFromFile(const FileName: string;
  Encoding: TEncoding);
begin

end;

end.




program testoverloadinclasshelper;

{$mode delphiunicode}

uses
  Classes, SysUtils, uStringListHelper;

var
  m: TStringList;
begin
  m := TStringList.Create;
  m.LoadFromFile('somefile.txt', TEncoding.UTF8);
end.


When I try to compile it, error "Wrong number of parameters ...." will be
shown. Based on documentation I found (
http://www.freepascal.org/docs-html/ref/refse50.html) it should be
possible. Is it a bug or am I missed something ?

One point more - when I had defined class helper type in same unit as main
program (so not in separate unit uStringListHelper), compiler behavior was
like there is no class helper defined. Is this correct as well ?

regards
tomas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to