Closed joshichaitanya3 closed 5 months ago
Great news, these were all from the same issue—mfcompile_set was failing to check whether the parameter had already been checked for single parameter functions. The same fix seems to repair all these failing examples. Thanks for these @joshichaitanya3!
A few more tests for multiple dispatch. The
namespace_for_new
test implements a new signature for a function in the namespace, and Morpho does run that implementation. Not sure what the intended behavior is here. I feel like this should be allowed as it will allow users to re-use code nicely.Not sure about the
namespace_for_overwrite
, which tries to redefine an already existing implementation from the namespace. I think this should just result in a standard multiple dispatch error of matching signatures.duplicate_no_types_two_arguments
is same as theduplicate
test, but the signature doesn’t contain types. This works correctly. Theduplicate_no_types
however has duplicate functions with a single untyped argument, and this fails due to a segfault. So does thenamespace_for_overwrite
test.The segfault is due to a compiler infinite loop (see block comments in the files for a backtrace).
Edit: Upon adding another duplicate test with a single typed argument that also fails, the problem seems to be for functions with one argument, and less to do with Type annotations.