On Monday, 9 April 2012 at 00:25:57 UTC, bearophile wrote:
Currently this code compiles and runs with no errors:
class Foo {
override string toString() const {
return "Foo";
}
}
void main() {
import std.stdio;
const Foo[] foos = [new Foo];
writeln(foos);
}
Maybe related to this?
http://d.puremagic.com/issues/show_bug.cgi?id=7864
On Mon, Apr 09, 2012 at 02:25:56AM +0200, bearophile wrote:
[...]
> While this gives errors:
>
> class Foo {
> override string toString() /*const*/ {
> return "Foo";
> }
> }
> void main() {
> import std.stdio;
> const Foo[] foos = [new Foo];
> writeln(foos);
Currently this code compiles and runs with no errors:
class Foo {
override string toString() const {
return "Foo";
}
}
void main() {
import std.stdio;
const Foo[] foos = [new Foo];
writeln(foos);
}
Output, DMD 2.059beta2:
[Foo]
While this gives errors