Re: [fpc-pascal] bug or feature?

2022-02-13 Thread Michael Van Canneyt via fpc-pascal



On Sun, 13 Feb 2022, Sven Barth via fpc-pascal wrote:


Personally, I would not allow this.
But Delphi compiles and runs it...


... and Delphi's class completion no longer works in the unit giving a
useless error "expected ';' but '.' found". So it is one of those
Delphi "features" compiling but not usable.


I'm all for forbidding this in objfpc mode.



Then file a bug report for it. Cause it's definitely going to be one of the
low priority things cause it's going to be annoying to fix...


Done:

https://gitlab.com/freepascal.org/fpc/source/-/issues/39576

Maybe someone can check whether Florian's solution really is 'famous last 
words' ;-)

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


Re: [fpc-pascal] bug or feature?

2022-02-13 Thread Florian Klämpfl via fpc-pascal

Am 13.02.2022 um 10:25 schrieb Sven Barth via fpc-pascal:
Michael Van Canneyt via fpc-pascal mailto:fpc-pascal@lists.freepascal.org>> schrieb am 
So., 13. Feb. 2022, 09:47:




On Sun, 13 Feb 2022, Mattias Gaertner via fpc-pascal wrote:

 > On Sat, 12 Feb 2022 12:14:14 +0100 (CET)
 > Michael Van Canneyt via fpc-pascal mailto:fpc-pascal@lists.freepascal.org>>
 > wrote:
 >
 >> On Sat, 12 Feb 2022, Mattias Gaertner via fpc-pascal wrote:
 >>
 >> > Hi,
 >> >
 >> > This can't be right, can it?
 >> >
 >> > type
 >> >  TBird = class
 >> >    procedure Fly;
 >> >  end;
 >> >  TEagle = TBird; // alias
 >> >
 >> > procedure TEagle.Fly;
 >> > begin
 >> > end;
 >>
 >> Personally, I would not allow this.
 >> But Delphi compiles and runs it...
 >
 > ... and Delphi's class completion no longer works in the unit giving a
 > useless error "expected ';' but '.' found". So it is one of those
 > Delphi "features" compiling but not usable.

I'm all for forbidding this in objfpc mode.


Then file a bug report for it. Cause it's definitely going to be one of the low priority things cause it's going to be 
annoying to fix...


I thought (famous last words), checking the typesyms of the tobjectdef would be 
enough but who knows what else will bit :)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] bug or feature?

2022-02-13 Thread Sven Barth via fpc-pascal
Michael Van Canneyt via fpc-pascal 
schrieb am So., 13. Feb. 2022, 09:47:

>
>
> On Sun, 13 Feb 2022, Mattias Gaertner via fpc-pascal wrote:
>
> > On Sat, 12 Feb 2022 12:14:14 +0100 (CET)
> > Michael Van Canneyt via fpc-pascal 
> > wrote:
> >
> >> On Sat, 12 Feb 2022, Mattias Gaertner via fpc-pascal wrote:
> >>
> >> > Hi,
> >> >
> >> > This can't be right, can it?
> >> >
> >> > type
> >> >  TBird = class
> >> >procedure Fly;
> >> >  end;
> >> >  TEagle = TBird; // alias
> >> >
> >> > procedure TEagle.Fly;
> >> > begin
> >> > end;
> >>
> >> Personally, I would not allow this.
> >> But Delphi compiles and runs it...
> >
> > ... and Delphi's class completion no longer works in the unit giving a
> > useless error "expected ';' but '.' found". So it is one of those
> > Delphi "features" compiling but not usable.
>
> I'm all for forbidding this in objfpc mode.
>

Then file a bug report for it. Cause it's definitely going to be one of the
low priority things cause it's going to be annoying to fix...

Regards,
Sven

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


Re: [fpc-pascal] bug or feature?

2022-02-13 Thread Michael Van Canneyt via fpc-pascal



On Sun, 13 Feb 2022, Mattias Gaertner via fpc-pascal wrote:


On Sat, 12 Feb 2022 12:14:14 +0100 (CET)
Michael Van Canneyt via fpc-pascal 
wrote:


On Sat, 12 Feb 2022, Mattias Gaertner via fpc-pascal wrote:

> Hi,
>
> This can't be right, can it?
>
> type
>  TBird = class
>procedure Fly;
>  end;
>  TEagle = TBird; // alias
>
> procedure TEagle.Fly;
> begin
> end; 

Personally, I would not allow this. 
But Delphi compiles and runs it...


... and Delphi's class completion no longer works in the unit giving a
useless error "expected ';' but '.' found". So it is one of those
Delphi "features" compiling but not usable.


I'm all for forbidding this in objfpc mode.

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


Re: [fpc-pascal] bug or feature?

2022-02-13 Thread Mattias Gaertner via fpc-pascal
On Sat, 12 Feb 2022 12:14:14 +0100 (CET)
Michael Van Canneyt via fpc-pascal 
wrote:

> On Sat, 12 Feb 2022, Mattias Gaertner via fpc-pascal wrote:
> 
> > Hi,
> >
> > This can't be right, can it?
> >
> > type
> >  TBird = class
> >procedure Fly;
> >  end;
> >  TEagle = TBird; // alias
> >
> > procedure TEagle.Fly;
> > begin
> > end;  
> 
> Personally, I would not allow this. 
> But Delphi compiles and runs it...

... and Delphi's class completion no longer works in the unit giving a
useless error "expected ';' but '.' found". So it is one of those
Delphi "features" compiling but not usable.


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


Re: [fpc-pascal] bug or feature?

2022-02-13 Thread Michael Van Canneyt via fpc-pascal



On Sun, 13 Feb 2022, Ryan Joseph via fpc-pascal wrote:





On Feb 12, 2022, at 11:40 PM, Jonas Maebe via fpc-pascal 
 wrote:

I wouldn't consider this to be working by design, but rather because of 
implementation limitations.


I agree and it should be fixed probably.


As I wrote in my initial answer to Mattias, I would also forbid it.
(despite the temptation to use it for shortening class names in the
implementation, I think it will be more confusing than helpful in the end)

But since Delphi allows it, we must continue to allow it in Delphi mode...

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