- Change InferTypeOpInterface::inferResultTypes to use fully qualified types matching the ones generated by genTypeInterfaceMethods, so the redundancy can be detected.
- Move genTypeInterfaceMethods() before genOpInterfaceMethods() so that the inferResultTypes method generated by genTypeInterfaceMethods() takes precedence over the declaration that might be generated by genOpInterfaceMethods()
- Modified an op in the test dialect to exercise this (the modified op would fail to generate valid C++ code due to duplicate inferResultTypes methods).
The fix here is such that TableGen generated inferReturnTypes takes precedence over the one generated by the InferTypeOpInterface. Just tagging the Op with the trait is not sufficient since I assume we also want the generated inferReturnTypes. The other possible fix is to avoid generating the TableGen generated inferReturnTypes method when the Op is tagged with DeclareOpInterfaceMethods<InferTypeOpInterface> and delegate the definition of the method to the user. I've erred on the side of using the TableGen one.