Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-03

Forward Generic Type Declaration Bug

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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

Reply by email

Sven Barth
"African Wild Dog" wrote 10 lines
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

Reply by email

African Wild Dog
to Sven Barth

2017-03-18 18:40 GMT-03:00 Sven Barth via fpc-pascal <

Show quoted text 5 lines
: Forward declarations for generic types are not supported. Are there plans for add suport for this in fpc 3.2?

Reply by email

Bart
to Sven Barth: With that I agree. Would you please check with 3.1.1 and if it's still the case there…
Sven Barth 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

Reply by email

Sven Barth
to Bart: A quick search in the bugtracker for this IE showed:…
"Bart" wrote
On 3/19/17, Sven Barth via fpc-pascal
>> 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

Show quoted text 6 lines
> 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

Reply by email