Thread overview
[Issue 1405] New: Stack overflow when getting type info string of an invariant array
Aug 08, 2007
d-bugmail
Oct 21, 2007
d-bugmail
Oct 21, 2009
Max Samukha
Oct 21, 2009
Stewart Gordon
Oct 21, 2009
Max Samukha
August 08, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1405

           Summary: Stack overflow when getting type info string of an
                    invariant array
           Product: D
           Version: 2.003
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: samukha@voliacable.com


invariant char[][] a = ["a", "b", "c"];

void main()
{
    auto s = typeid(typeof(a)).toString;
}

Error: Stack Overflow


-- 

October 21, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1405


smjg@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg@iname.com




------- Comment #1 from smjg@iname.com  2007-10-21 12:07 -------
Seems to work DMD 2.006.  But the result doesn't seem right.  Adding a write statement gives:

invariant invariant char[][]


-- 

October 21, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1405


Max Samukha <samukha@voliacable.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #2 from Max Samukha <samukha@voliacable.com> 2009-10-21 00:52:16 PDT ---
dmd 2.035 outputs immutable(immutable(immutable(char)[])[]) which seems to be
correct

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 21, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1405



--- Comment #3 from Stewart Gordon <smjg@iname.com> 2009-10-21 01:20:20 PDT ---
(In reply to comment #2)
> dmd 2.035 outputs immutable(immutable(immutable(char)[])[]) which seems to be
> correct

Technically yes, though it ought to collapse the redundant immutables.

immutable(char[][])

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 21, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1405



--- Comment #4 from Max Samukha <samukha@voliacable.com> 2009-10-21 01:43:47 PDT ---
Probably, yes. On the other hand, the non-normalized string can be easily parsed as immutable reference to immutable array of immutable strings. Anyway, it is not a bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------