On Saturday, 29 November 2014 at 19:35:52 UTC, Daniel Kozak wrote:
module main;
import std.stdio;
struct A {}
static A a;
void main() {
writeln(main.a);
}
this code does not work, because it try to use main function
instead of main module. Even error message is wierd: Error:
struct A does not overload ()
It's a little confusing but it is referring to module main and
not the function main. I think the error message is because
struct A doesn't define opCall. See:
http://dlang.org/operatoroverloading.html#function-call
I tried to provide an example, but I couldn't get the code to
compile myself. :-/