Bug 5383 – writeln of alias-this matrix

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-12-28T02:09:00Z
Last change time
2012-10-27T10:41:17Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-12-28T02:09:15Z
I think this bug report is about two related but different bugs. A D2 program: import std.stdio: writeln; struct Mat { int[][] a; alias a this; } void main() { writeln(Mat()); } DMD 2.051 prints: ...\dmd\src\phobos\std\format.d(1149): Error: function expected before (), not popFront(arr.a) of type void ---------------------------- A similar D2 program: import std.stdio: writeln; struct Mat { int[1][1] a; alias a this; } void main() { writeln(Mat()); } DMD 2.051 prints: toString(int[1u][1u]) called from ...\dmd\src\phobos\std\format.d(1432) is deprecated. Instead you may want to import std.conv and use to!string(x) instead of toString(x). toString(int[1u][1u]) called from ...\dmd\src\phobos\std\format.d(1441) is deprecated. Instead you may want to import std.conv and use to!string(x) instead of toString(x). toString(int[1u][1u]) called from ...\dmd\src\phobos\std\format.d(1451) is deprecated. Instead you may want to import std.conv and use to!string(x) instead of toString(x). Mat (I also suggest to perform a search for "toString(" in format.d)
Comment #1 by hsteoh — 2012-10-27T10:23:42Z
This bug no longer occurs on git HEAD. Looks like it's been fixed. Should it be closed?
Comment #2 by k.hara.pg — 2012-10-27T10:41:17Z
(In reply to comment #1) > This bug no longer occurs on git HEAD. Looks like it's been fixed. Should it be > closed? This is fixed in 2.059.