[Python Bindings] Terminator Op not recognized as terminator


I’m struggling with a ReturnLike op python binding with my dialect. In the generated .h.inc file it has the trait IsTerminator, but when I try to generate mlir with the operation, I get the following error:

error: block with no terminator, has <return op>

When I put another operation below the return op, it recognizes that my return op needs to be last in the block, though. Can anyone give me any pointers?


This is likely a setup issue: you built multiple shared libraries for your bindings that led to duplicated copies of MLIR in the program right now.

1 Like