import std.stdio; class Foo { public void opCall(int x) { this.y = x; } public int y; } void main() { Foo bar = new Foo(); bar = 5; writeln(bar.y); }
Standard input is empty
prog.d(12): Error: cannot implicitly convert expression (5) of type int to prog.Foo prog.d(12): Error: cannot cast int to prog.Foo
Standard output is empty