Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/RTTI    [ Add a report in this area ]  
Report #:  95340   Status: Open
Dynamic array of static array misses typeinfo
Project:  Delphi Build #:  15.0.3953.35171
Version:    15.1 Submitted By:   Stefan Glienke
Report Type:  Basic functionality failure Date Reported:  6/18/2011 7:20:53 PM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   283949
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
---
    if TRttiDynamicArrayType(t).ElementType <> nil then // <- expected to be assigned but actually it's nil
---

see steps

Steps to Reproduce:
unit TestCase;

interface

type
  TDynMatrixA = array of array[0..1] of Integer;

procedure Test;

implementation

uses
  Rtti,
  TypInfo;

procedure Test;
var
  a: TDynMatrixA;
  c: TRttiContext;
  t: TRttiType;
begin
  t := c.GetType(TypeInfo(TDynMatrixA));
  if t is TRttiDynamicArrayType then
  begin
    if TRttiDynamicArrayType(t).ElementType <> nil then // <- expected to be assigned but actually it's nil
      Writeln(TRttiDynamicArrayType(t).ElementType.Name);
  end
  else if t is TRttiArrayType then
  begin
    if TRttiArrayType(t).ElementType <> nil then
      Writeln(TRttiArrayType(t).ElementType.Name);
  end;
end;

end.
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01