Question: mint says variable is not used when it is.

Whenever I have local proc inside a proc, and use local variables from the outer proc inside it, Mint tells me that the variables are not used.

This can't be right. Why does it say that? Here is MWE. I have this foo.mpl file

foo := proc()

local C1;
local y,x;

    proc()
        C1:= `tools/genglobal`(_C); 
        sol:=y(x)=  C1; 
    end proc();

end proc;

We see clearly that C1 is used, also x and y are used. There can be more code using these inside the inner proc. But this is what mint says

"C:\Program Files\Maple 2024\bin.X86_64_WINDOWS\mint.exe" foo.mpl

    |\^/|      Maple 2024 Diagnostic Program
._|\|   |/|_.  Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2024
 \  MINT   /   All rights reserved. Maple is a trademark of
 <____ ____>   Waterloo Maple Inc.
      |
Procedure foo() on lines 1 to 11
  These local variables were never used:  C1, x, y

Any idea why it says these are not used?

Also, I noticed it did not warn me that variable sol is global inside the proc. i.e. I was expecting something like this 

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

Which is typical message mint gives when using a name inside a proc which was not declared,

Maple 2024.2 on Windows

Please Wait...