Question: unable to access super class local variable when extending with subclass

This setup works, where B extends A, then B method access local variable in A directly, since it now becomes part of the object B itself

restart;
                            
module A()
  option object;
  local s::string:="";
end module;

module B()
   option object(A);
   export foo::static:=proc(_self,$)
      _self:-s := cat(_self:-s,"something");
      print(_self:-s);
   end proc:
end module;

o:=Object(B);
o:-foo()

Gives "something"

Now, I changed B, by adding an anonymous local proc() and did the same exact thing as above, which is to access s.

Now Maple complains that B does not export s

restart;

module A()
  option object;
  local s::string:="";
end module;

module B()
   option object(A);
   export foo::static:=proc(_self,$)
        proc()
            _self:-s:=cat(_self:-s,"somethig");
            print(_self:-s);
        end proc();
   end proc:
end module;

o:=Object(B);
o:-foo()

It gives

Error, (in anonymous procedure called from anonymous procedure) module `B` does not export `s`

Could someone help me understand why this happens? How it works in the first example but not in the second?  I do not see why it would make difference. isn't anonymous procedure part of the class that is being extended?

Update

It is worst than I thought. Even named local proc, inside method now fail. Here is an example

restart;

module A()
  option object;
  local s::string:="";
end module;

module B()
   option object(A);
   export foo::static:=proc(_self,$)
        local z::string:="something";
        local my_inner_proc:=proc()
            _self:-s:=cat(_self:-s,z);
        end proc();
        my_inner_proc();
   end proc:
end module;

o:=Object(B);
o:-foo()

Gives 

Error, (in anonymous procedure called from anonymous procedure) module `B` does not export `s`
I was using code which worked before, but now after extending the class, I am finding all these problems.

Is this documented something that local proc()'s inside method do not work as expected when extending classes in Maple OOP? It means now I have to move these local proc() to the outside of its current enclosing proc() to make Maple happy.  I just do not understand why this limitation.

Maple 2023.1 on Windows 10

Please Wait...