Regression between 3.0.0 and 3.0.2 related to generics
Original Reporter info from Mantis: Wallaby
-
Reporter name:
Original Reporter info from Mantis: Wallaby
- Reporter name:
Description:
Certain valid code causes the compiler to crash with stack overflow.
Steps to reproduce:
Just compile the following program:
program Project2;
{$MODE DELPHI}
uses
FGL;
type
THWAddr = record
public type
THWBytes = array [0..5] of Byte;
private
FValue: THWBytes;
public
class var Empty: THWAddr;
class var Broadcast: THWAddr;
end;
TGWCache = class(TFPGList<THWAddr>);
begin
end.
Additional information:
On FPC 3.0.0 it correctly complains about operators not being overloaded (this is a just an excerpt).
On FPC 3.0.2 it crashes the compiler with EStackOverflow.
The culprit seems to be the "class var" lines - when they are commented out, it no longer crashes. I have attached the screen shots with compiler output and the the program's text.
Mantis conversion info:
- Mantis ID: 31465
- Build: 3.0.2
- Platform: Windows 32-bit
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 35508 (#ece13bcc)