Question: strange warning message from mint which do not show in maplemint

everytime I run mint I get hundreds of messages coming from child modules, saying

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

Where A above is the name of the top level module.

This only shows from commnd line mint, and not from maplemint used in the GUI.

The set I have is 

A:=module()
    export module foo_type()
       option object;
       ....
    end module;

     export B := module()  #child module
       .....
     end module;
end module;

  In the child module B above, whever I do 

                 o:=Object(A:-foo_type);

mint gives the above warning.

It is clear the name A should not be declared, as the module B is child to it so it can see it.

The workaround is to add  global A inside each child module to remove this warning. 

But why is this needed?

Here is a worksheet showing maplemint does not show this warning, and below example using command line mint on same exact code, which does

restart;

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

A:=module()

    export module foo_type()
       option object;
       export name::string:="";
    end module;

    export B := module()
       export step := proc()::A:-foo_type;                 
       local o::A:-foo_type;   
          o:=Object(A:-foo_type);
          o:-name:="x";
          return o;
       end proc;

    end module;

end module;

_m128759219362528

maplemint(A)

Nested Module foo_type() on lines 1 to 2
  These exported variables were never used:  name::string

 

 

Download mint_isse_april_25_2025.mw

Here is A.mpl 

A:=module()

    export module foo_type()
       option object;
       export name::string:="";
    end module;

    export B := module()    
       #global A;     why is this needed for mint??
       export step := proc()::A:-foo_type;                 
       local o::A:-foo_type;   
          o:=Object(A:-foo_type);
          o:-name:="x";
          return o;
       end proc;

    end module;
end module;

And now the command

>/home/me/maple2025/bin.X86_64_LINUX/mint A.mpl
    |\^/|      Maple 2025 Diagnostic Program
._|\|   |/|_.  Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2025
 \  MINT   /   All rights reserved. Maple is a trademark of
 <____ ____>   Waterloo Maple Inc.
      |        
Nested Procedure step() on lines 10 to 15
  These names were used as global names but were not declared:  A
Module A() on lines 1 to 18
  These exported variables were never used:  foo_type
>

You see the difference. mint complains that A is not declared.

Is this a bug in mint?

Please Wait...