Forward Generic Type Declaration Bug

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Forward Generic Type Declaration Bug

African Wild Dog
Hello,

Please confirm if this is a bug.

When I try to compile the unit below I get the error:

"generics_bug.pas(14,43) Fatal: Internal error 2012101001"

It seems the compiler has bug when handling forward generics declaration.

Tested on: Debian Jessie amd64 - fpc 3.0.2

=== CODE ===

unit generics_bug;

{$mode delphi}

interface


type

  IGenericInterface<T> = interface; // Forward   

  TGenericClass<T> = class
  private
    FGenericInterface: IGenericInterface<T>;   
  end;       
   
  IGenericInterface<T> = interface
  end;     
   
 
implementation

end.


===


Regards

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Forward Generic Type Declaration Bug

Free Pascal - General mailing list

Am 18.03.2017 19:20 schrieb "African Wild Dog" <[hidden email]>:
>
> Hello,
>
> Please confirm if this is a bug.
>
> When I try to compile the unit below I get the error:
>
> "generics_bug.pas(14,43) Fatal: Internal error 2012101001"
>
> It seems the compiler has bug when handling forward generics declaration.

Forward declarations for generic types are not supported.

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Forward Generic Type Declaration Bug

African Wild Dog
2017-03-18 18:40 GMT-03:00 Sven Barth via fpc-pascal <[hidden email]>:

Forward declarations for generic types are not supported.

Are there plans for add suport for this in fpc 3.2?


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Forward Generic Type Declaration Bug

Bart-48
In reply to this post by Free Pascal - General mailing list
On 3/18/17, Sven Barth via fpc-pascal <[hidden email]> wrote:

> Forward declarations for generic types are not supported.

But it should not give an internal error.

Bart
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Forward Generic Type Declaration Bug

Free Pascal - General mailing list
In reply to this post by African Wild Dog

Am 18.03.2017 23:27 schrieb "African Wild Dog" <[hidden email]>:
>
> 2017-03-18 18:40 GMT-03:00 Sven Barth via fpc-pascal <[hidden email]>:
>>
>> Forward declarations for generic types are not supported.
>
> Are there plans for add suport for this in fpc 3.2?

No, there are not.

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Forward Generic Type Declaration Bug

Free Pascal - General mailing list
In reply to this post by Bart-48

Am 19.03.2017 00:02 schrieb "Bart" <[hidden email]>:
>
> On 3/18/17, Sven Barth via fpc-pascal <[hidden email]> wrote:
>
> > Forward declarations for generic types are not supported.
>
> But it should not give an internal error.

With that I agree. Would you please check with 3.1.1 and if it's still the case there report a bug so that this isn't forgotten?

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Forward Generic Type Declaration Bug

Bart-48
On 3/19/17, Sven Barth via fpc-pascal <[hidden email]> wrote:

> With that I agree. Would you please check with 3.1.1 and if it's still the
> case there report a bug so that this isn't forgotten?

r35221 (a bit old maybe) gives an IE.

Bart
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Forward Generic Type Declaration Bug

Bart-48
In reply to this post by Free Pascal - General mailing list
On 3/19/17, Sven Barth via fpc-pascal <[hidden email]> wrote:

>> But it should not give an internal error.
>
> With that I agree. Would you please check with 3.1.1 and if it's still the
> case there report a bug so that this isn't forgotten?

A quick search in the bugtracker for this IE showed:
http://bugs.freepascal.org/view.php?id=26452 (Internal error
2012101001 with forward template declaration).
It's the same issue I guess?

Bart
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Forward Generic Type Declaration Bug

Bart-48
In reply to this post by Bart-48
On 3/19/17, Bart <[hidden email]> wrote:

> r35221 (a bit old maybe) gives an IE.

Still present in r35625 (today).

Bart
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Forward Generic Type Declaration Bug

Free Pascal - General mailing list
In reply to this post by Bart-48

Am 19.03.2017 11:30 schrieb "Bart" <[hidden email]>:
>
> On 3/19/17, Sven Barth via fpc-pascal <[hidden email]> wrote:
>
> >> But it should not give an internal error.
> >
> > With that I agree. Would you please check with 3.1.1 and if it's still the
> > case there report a bug so that this isn't forgotten?
>
> A quick search in the bugtracker for this IE showed:
> http://bugs.freepascal.org/view.php?id=26452 (Internal error
> 2012101001 with forward template declaration).
> It's the same issue I guess?

Yes. Thank you for checking.

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal