Overriding <: function for subtype checking


#1
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


#2

Is there a question?


#3

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


#4

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.


#5

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?