[fpc-devel] Type+multi helpers overload bug

2022-05-07 Thread Hairy Pixels via fpc-devel
Basically it looks like multi helpers don’t actually work with overloaded 
methods and simply choses the last helper declared. Should I fix this? Seems 
unlikely we would not notice this before but maybe we did.

{$modeswitch typehelpers}
{$modeswitch multihelpers}

type
  TMyHelper1 = type helper for integer
procedure DoThis(f: integer);
  end;
  TMyHelper2 = type helper for integer
procedure DoThis(f: string);
  end;

procedure TMyHelper1.DoThis(f: integer);
begin
  writeln(self, ' => ', f);
end;

procedure TMyHelper2.DoThis(f: string);
begin
  writeln(self, ' => ', f);
end;

var
  i: integer = 0;
begin
  i.DoThis(0);  // Got "ShortInt", expected “ShortString"

Regards,
Ryan Joseph

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] TShiftState

2022-05-07 Thread Mattias Gaertner via fpc-devel
On Sat, 7 May 2022 10:21:26 +0200 (CEST)
Michael Van Canneyt via fpc-devel 
wrote:

> On Sat, 7 May 2022, Mattias Gaertner via fpc-devel wrote:
> 
> > Hi,
> >
> > Delphi has some extra TShiftState enums: ssTouch, ssPen,
> > ssHorizontal
> >
> > https://docwiki.embarcadero.com/Libraries/Sydney/en/System.Classes.TShiftState
> >
> > I propose for fpc to add these three and add an alias
> >
> > constant
> >  ssCommand = ssMeta;
> >
> > What do you think?  
> 
> Compiler got scared by your idea:
> 
> > fpc a.pp  
> a.pp(1,9) Fatal: Syntax error, "BEGIN" expected but "identifier
> CONSTANT" found Fatal: Compilation aborted
> Error: /usr/local/bin/ppcx64 returned an error exitcode

lol. I should not work at that time.

 
> After some calming down the compiler I committed & pushed your idea.

Thanks!

Mattias

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] qoi image file format support

2022-05-07 Thread Michael Van Canneyt via fpc-devel



On Sat, 7 May 2022, Marģers . via fpc-devel wrote:


There is this super new, super fast and super what not image format. I have 
added support for fcl-images.
attached zip file contains:

1) read and write support in files
qoif/qoicomn.pas
qoif/fpwriteqoi.pas
qoif/fpreadqoi.pas

2) example of read and write QOI file
qoif/wrqoif.pas
qoif/wrpngf.pas

more information about QOI https://qoiformat.org

example images https://qoiformat.org/qoi_test_images.zip


Impressive, and such a simple format...
I committed and pushed your implementation. Thank you very much !

Michael.___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] TShiftState

2022-05-07 Thread Michael Van Canneyt via fpc-devel




On Sat, 7 May 2022, Mattias Gaertner via fpc-devel wrote:


Hi,

Delphi has some extra TShiftState enums: ssTouch, ssPen, ssHorizontal

https://docwiki.embarcadero.com/Libraries/Sydney/en/System.Classes.TShiftState

I propose for fpc to add these three and add an alias

constant
 ssCommand = ssMeta;

What do you think?


Compiler got scared by your idea:


fpc a.pp

a.pp(1,9) Fatal: Syntax error, "BEGIN" expected but "identifier CONSTANT" found
Fatal: Compilation aborted
Error: /usr/local/bin/ppcx64 returned an error exitcode


After some calming down the compiler I committed & pushed your idea.

Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel