Overriding <: function for subtype checking

ERROR: cannot add methods to a builtin function

Why can’t I do that? And is there a way to dispatch based on the defined <: function in a polymorphic way?

Thanks

Is there a question?

Sorry, i posted early by mistake. Added the question.

No, you cannot change the way subtyping works. Doing so would break everything. You can make your own generic function that calls <: and can be modified over that but dispatch will not use it.

1 Like

Given your previous question about overriding =, I am curious what problem you are trying to solve. Maybe there is a simpler way to get what you want?