Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.

Public Report
Report From: Delphi Prism/Compiler    [ Add a report in this area ]  
Report #:  98550   Status: Open
Internal error in compiler with nested set types
Project:  Embarcadero Prism Build #:  5.0.29.893
Version:    2010.1 Submitted By:   Robert Ogren
Report Type:  Basic functionality failure Date Reported:  9/5/2011 5:20:39 AM
Severity:    Infrequently encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   287448
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Code similar to the following, which compiled fine in the Spring 2011 release, does not work in XE2 (Oxygene version 5.0.29.893).

type

  MyMainClass = class;

  MySomething nested in MyMainClass = public (
    Value1,
    Value2
  );

  MyUnnestedSomethings = set of MyMainClass.MySomething;

  MyNestedSomethings nested in MyMainClass = set of MyMainClass.MySomething;

  MyMainClass = class
  public
    // This is OK
    theSomething: MySomething;
    // This is OK
    theUnnestedSomethings: MyUnnestedSomethings;
    // This causes internal error
    theNestedSomethings: MyNestedSomethings;
  end;


It produces the following error when compiling


Error
1
(E0) Internal error: System.NullReferenceException: Object reference not set to an instance of an object.
   at H.p.A(c A, String a)
   at F.O.A(n A, c a, String B, h b)
   at F.O.A(n A, q a, String B, String b, h C, Action`2 c)
   at E.P.A(O A, n a)
   at F.O.A(n A, N a)
   at F.O.E.VisitTypeReference(N A)
   at RemObjects.Oxygene.Code.BaseVisitor.VisitVarDefinition(X element)
   at RemObjects.Oxygene.Code.BaseVisitor.VisitVarBlock(s element)
   at RemObjects.Oxygene.Code.BaseVisitor.Visit(u element)
   at RemObjects.Oxygene.Code.BaseVisitor.VisitTypeDefinition(V element)
   at RemObjects.Oxygene.Code.BaseVisitor.VisitTypeReference(N element)
   at F.O.E.VisitTypeReference(N A)
   at F.O.E.VisitTypeName(U A)
   at RemObjects.Oxygene.Code.BaseVisitor.VisitTypeBlock(S element)
   at RemObjects.Oxygene.Code.BaseVisitor.Visit(u element)
   at RemObjects.Oxygene.Code.BaseVisitor.VisitInterface(p element)
   at RemObjects.Oxygene.Code.BaseVisitor.VisitFile(O element)
   at F.O.a(O A)
   at F.O.n()
   at F.O.G()

0
0
NestedTypes
Steps to Reproduce:
Paste the code above into the interface section of any unit, for example a blank console application. You can also use the attached console project.
Workarounds
Do not nest set types.
Attachment
NestedTypes.zip
Comments

None

Server Response from: ETNACODE01