Bug 1405 – Stack overflow when getting type info string of an invariant array
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2007-08-08T07:41:00Z
Last change time
2015-06-09T01:14:15Z
Assigned to
nobody
Creator
samukha
Comments
Comment #0 by samukha — 2007-08-08T07:41:02Z
invariant char[][] a = ["a", "b", "c"];
void main()
{
auto s = typeid(typeof(a)).toString;
}
Error: Stack Overflow
Comment #1 by smjg — 2007-10-21T12:07:35Z
Seems to work DMD 2.006. But the result doesn't seem right. Adding a write statement gives:
invariant invariant char[][]
Comment #2 by samukha — 2009-10-21T00:52:16Z
dmd 2.035 outputs immutable(immutable(immutable(char)[])[]) which seems to be correct
Comment #3 by smjg — 2009-10-21T01:20:20Z
(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[][])
Comment #4 by samukha — 2009-10-21T01:43:47Z
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.