View Issue Details

IDProjectCategoryView StatusLast Update
0026452FPCCompilerpublic2019-08-30 15:14
ReporterBoris Popov Assigned ToSven Barth  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionduplicate 
Platformx64OSUbuntu 12.04 
Product Version2.7.1 
Summary0026452: Internal error 2012101001 with forward template declaration
DescriptionCompile always fails with cryptic error message:

rtempl.pas(10,27) Fatal: Internal error 2012101001
Fatal: Compilation aborted
Steps To ReproduceCompile the following code:

program rtempl;

{$mode delphi}

type
  TArray<T> = class;

  TList<T> = class
  public
    function fn1: TArray<T>;
  end;

  TArray<T> = class
    function fn2: TList<T>;
  end;

begin
end.
Tagsgenerics, internal error
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Relationships

duplicate of 0034128 acknowledged Support for forward declarations of generic types 

Activities

Sven Barth

2014-07-05 20:56

manager   ~0076088

This is not a cryptic error, but an internal error which means that some expectation of the compiler didn't hold up. Since the numbers of internal errors are unique their location is easily to pinpoint. In that regard they are the best kind of errors ;)

Regarding your problem at hand: forward declarations of generics are not supported.

Regards,
Sven

Boris Popov

2014-07-06 09:52

reporter   ~0076098

Yeah, I've found this error by grepping, but resulting condition wasn't less cryptic to me :).

Are there any workaround for the above case? I'm writing an interface to C++ library which heavy uses such declarations and the only solution found was to use generic pointers instead of forward declarations.

Sven Barth

2019-08-30 15:14

manager   ~0117878

I'm resolving this as a duplicate for the younger one as that has a potential patch attached.

Issue History

Date Modified Username Field Change
2014-07-05 13:42 Boris Popov New Issue
2014-07-05 20:56 Sven Barth Note Added: 0076088
2014-07-05 20:56 Sven Barth Tag Attached: generics
2014-07-05 20:56 Sven Barth Tag Attached: internal error
2014-07-06 09:52 Boris Popov Note Added: 0076098
2019-08-30 15:14 Sven Barth Assigned To => Sven Barth
2019-08-30 15:14 Sven Barth Status new => resolved
2019-08-30 15:14 Sven Barth Resolution open => duplicate
2019-08-30 15:14 Sven Barth FPCTarget => -
2019-08-30 15:14 Sven Barth Note Added: 0117878
2019-08-30 15:14 Sven Barth Relationship added duplicate of 0034128