Question: These names were used as global names but were not declared. How to correct?

When running mint on a single .mpl file, I often get this warning

These names were used as global names but were not declared:  main_module

When having this code in the mpl file

o:=Object(main_module:-person_type);

The problem is that main_module is a module that lives in separate mpl file.

It is a differerent module in its own ,mpl file which inside it contains the person_type definition. (another module of type object)

I know I can ignore this. And have been. But my question is: how does one "declare" main_module inside this mpl file to avoid getting this warning message? Since main_module is its own module in separate file. I do not understand what does it mean to  "declare" it.

Here is the full code

A:=module()
   export boo:=proc()
      local o;
      o:=Object(main_module:-person_type);
      o:-foo();
   end proc;
end module;

And here is the command I used

"C:\Program Files\Maple 2022\bin.X86_64_WINDOWS\mint.exe" -i 2 A.mpl

Gives

Nested Procedure boo() on lines 2 to 6
  These names were used as global names but were not declared:  main_module

Later on, when I build my .mla library, all these modules are put inside the library. So it is not an issue when running the code, but I'd like to see if it is possible to add something to A.mpl to tell Maple that main_module is separate module and not to worry about it.

 

Please Wait...