Question: Why assignment type mismatch can not be cought by try/catch when assertion level is 2?

I do not know if this is how it always been in Maple. But now I noticed when I set assertlevel to 2, in order to catch wrong assignment type in my code, the try/catch do not catch such an error.  

My question is: Has it always been like this in Maple? May be it was, I am just asking for confirmation. I seem to remember I was able to trap such error before.

Here is MWE

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1793 and is the same as the version installed in this computer, created 2024, August 25, 9:6 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

interface(warnlevel=4):
kernelopts('assertlevel'=2):

 

foo:=proc();
local C_sol::list;
   try
      C_sol := 1;
   catch:
      print("error detected in my code");
   end try;
end proc:

foo(); #unable to catch assignment error

Error, (in foo) assertion failed in assignment to C_sol, expected list, got 1

 

 

Download why_trap_do_not_catch_assignment_error.mw

Please Wait...