Function with same name as a module name

Daniel Kozak via Digitalmars-d digitalmars-d at puremagic.com
Sat Nov 29 11:35:51 PST 2014


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 ()


More information about the Digitalmars-d mailing list