Hi Damian,
This warning typically means you've written some code without having an
explicit module declaration around the full contents of the file. We
added this because in cases where a file has evolved to the point where
its contents are ready for being used in other files, users were having
trouble figuring out how to actually use the code in the file.
For instance, say you have a file like this:
foo.chpl
module One { ... }
module Two { ... }
proc someFunc() { ... }
The function someFunc
may have been added at the beginning of the
file's existence. Maybe the user had most recently been working on the
contents of module One
and forgotten what else was in the file. But
its presence means there is something defined in the file that otherwise
would not be in a module at all, and all non-module definitions need to
be inside a module (whether one created by the compiler or one defined
by the user). So the compiler creates a module to hold someFunc
in
the meanwhile, and doesn't worry too much about it.
It starts to matter if the user becomes ready to write code like this in
another file:
bar.chpl
import One;
One.someOtherFunc();
Here, they're going to get a compilation error, because an implicit
module has been inserted around the entire contents of foo to hold
someFunc
, so One
isn't visible like it would be if it was defined in
a file by itself. One
is actually inside a module named foo
, so
what they'd need to write is:
bar.chpl
import foo.One;
One.someOtherFunc();
Since we don't know when a user reaches the point where they want a
file's contents to be accessible to other files, we generate this
warning when we make that wrapper module, so that they know that this
outer wrapping module exists and that they need to take some action if
they don't like that (such as defining their own module around the whole
contents of the file, or moving someFunc
into module Two
, or its own
file, or even a new module Three
).
If your code is intended to be more "script-like" for its entire
existence instead of having its contents referenced in other files, it
is safe to ignore this warning.
Thanks,
Lydia