Forward declaration not solved for generic functions that work on generic advanced record subtypes
Original Reporter info from Mantis: alaviss
-
Reporter name:
Original Reporter info from Mantis: alaviss
- Reporter name:
Description:
{$MODESWITCH RESULT}
{$MODESWITCH ADVANCEDRECORDS}
Type
generic TGData<T> = record
public type
// FIXME: Compiler bug, details see:
// http://lists.freepascal.org/pipermail/fpc-pascal/2016-November/049444.html
TSelf = specialize TGData<T>;
PSelf = ^TSelf;
public
d: T;
n: PSelf
end;
generic Function Init&LtPos;T>: specialize TGData&LtPos;T>.PSelf; forward;
generic Function Init<T>: specialize TGData<T>.PSelf;
Begin
new(result);
result^.d := default(T);
result^.n := nil
End;
Begin
End.
Steps to reproduce:
- Compile the attachment
Error message:
Free Pascal Compiler version 3.1.1 [2016/11/29] for x86_64
Copyright (c) 1993-2016 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling bug.pas
bug.pas(19,18) Error: Forward declaration not solved "DoSomething$1:^TGData1
crc97B3D851;"
bug.pas(31) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode