I would like to make sure that function in module that I have won't be imported, is this possible to achieve?

Test subject:


mainFile.d
import otherFile;
void main(){
        
}

otherFile.d
import std.stdio : writeln;
import std.file  : mkdir;

int main(){
        writeln("test ");
        return 0;
}


Error, main() method has been imported:
how to disallow main() method from being imported?
otherFile.d(5): Error: only one main, WinMain, or DllMain allowed. Previously found main at mainFile.d(3)

Reply via email to