[fpc-pascal] Delphi generics bug?

2020-01-14 Thread Ryan Joseph via fpc-pascal
Is this a bug or intended behavior? I would think there should a type mismatch.

{$mode delphi}
program test;

type
  TFooA = class
  end;

type
  TFooB = class
  end;

type
  TList = class
procedure Foo;
  end;

procedure TList.Foo;
begin
end;  

begin
end.



Regards,
Ryan Joseph

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


Re: [fpc-pascal] Delphi generics bug?

2020-01-14 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal  schrieb am
Di., 14. Jan. 2020, 11:26:

> Is this a bug or intended behavior? I would think there should a type
> mismatch.
>
> {$mode delphi}
> program test;
>
> type
>   TFooA = class
>   end;
>
> type
>   TFooB = class
>   end;
>
> type
>   TList = class
> procedure Foo;
>   end;
>
> procedure TList.Foo;
> begin
> end;
>
> begin
> end.
>

It's a bug because constraints should not be allowed in definitions, only
in declarations.

Regards,
Sven

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


Re: [fpc-pascal] Delphi generics bug?

2020-01-14 Thread Ryan Joseph via fpc-pascal


> On Jan 14, 2020, at 8:04 PM, Sven Barth via fpc-pascal 
>  wrote:
> 
> It's a bug because constraints should not be allowed in definitions, only in 
> declarations. 
> 

ok, I'll file a report if you want me to. I'll just leave it as it is for the 
constants because the fix will probably encompass both of them.

Regards,
Ryan Joseph

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


Re: [fpc-pascal] Delphi generics bug?

2020-01-14 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal  schrieb am
Di., 14. Jan. 2020, 14:31:

>
>
> > On Jan 14, 2020, at 8:04 PM, Sven Barth via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >
> > It's a bug because constraints should not be allowed in definitions,
> only in declarations.
> >
>
> ok, I'll file a report if you want me to. I'll just leave it as it is for
> the constants because the fix will probably encompass both of them.
>

Indeed. And yes, please file a bug.

Regards,
Sven

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


Re: [fpc-pascal] Delphi generics bug?

2020-01-14 Thread Ryan Joseph via fpc-pascal


> On Jan 14, 2020, at 11:44 PM, Sven Barth via fpc-pascal 
>  wrote:
> 
> Indeed. And yes, please file a bug. 
> 

https://bugs.freepascal.org/view.php?id=36584

Regards,
Ryan Joseph

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