I am attempting to use
cf.assert MLIR operation within Mojo to raise compile time error in a Mojo program.
Just want to confirm
cf.assert is capable of raising compile time error and halt the compilation of a program with LLVM backend.
No, it is not capable of raising a compile-time error. It is a runtime assertion, similarly to
assert in Python or
assert() in C++. It wouldn’t be possible to do compile-time assertion without interpreting the IR that defines the operand of the assert at compile time, by the way.