A library (KernelF but it’s not important which one it is) defines some types and some operations and relationships between them. In particular, it defines some overloaded operations containers to specify that e.g. EqualsExpression can be applied to two EnumTypes as long as they are for the same enum.
My project is extending the library and defining a ‘nothing’ type which is a subtype of every type. To express this fact we added a replacement rule (much like in the documentation). However, now when I write an expression comparing a ‘nothing’ to an enum, my overload rule gets activated, tries to find out the enum of ‘nothing’ (treating it as an EnumType), and fails.
I get a warning about ‘conflicting rules for overloaded operation type’ because rules for other unrelated types are applied, e.g. (RealType, RealType) and (RealType, RationalType), and so on.
Attempting to fix this by creating an overloaded operation rule for (NothingType, Type) and (Type, NothingType) doesn’t work. Is there some way to specify that some overloaded operations rules should have precedence over other rules? What could I do to make this work? This is in MPS 2025.1.