Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Generics    [ Add a report in this area ]  
Report #:  114956   Status: Closed
[XE2 ICE REGRESSION] System.New fails for pointers to instantiated generics
Project:  Delphi Build #:  18.0.4854.59655
Version:    18.0 Submitted By:   Blaise Thorn
Report Type:  Crash / Data loss / Total failure Date Reported:  4/14/2013 6:53:06 PM
Severity:    Commonly encountered problem Last Updated: 7/13/2014 3:41:26 AM
Platform:    All platforms Internal Tracking #:   38452
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE6
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 40
Description
This is a regression happened in Delphi XE2 Update 4.

Tags: F2084 ICE Gxxxx
Steps to Reproduce:
----------8<----------
type R<T> = record F: T end;

type G<T> = record

type O = object F: Pointer end;
end;

var
X: ^R<Integer>;
var
Y: ^G<Integer>.O;
begin
{$AppType COnsole}

new(X);

// ^-- SINCE XE2u4: F2084 Internal Error: G9xxx

dispose(X); // OK


new(Y);

// ^-- SINCE XE3: F2084 Internal Error: G9xxx

dispose(Y); // OK


writeln('PASS')
end.
----------8<----------
Workarounds
Pre-instantiate the used generic types:

type Workaround1 = R<Integer>;

type Workaround2 = G<Integer>.O;
Attachment
None
Comments

None

Server Response from: ETNACODE01