[Mlir-commits] [mlir] [MLIR][Python] Make init parameters follow the field definition order (PR #186574)
Rolf Morel
llvmlistbot at llvm.org
Tue Mar 17 14:57:11 PDT 2026
================
@@ -124,38 +124,38 @@ class ConstraintOp(Test.Operation, name="constraint"):
y: FloatAttr
class OptionalOp(Test.Operation, name="optional"):
- a: Operand[i32]
- b: Optional[Operand[i32]]
out1: Result[i32]
- out2: Result[i32] | None
out3: Result[i32]
+ a: Operand[i32]
+ out2: Result[i32] | None = None
+ b: Optional[Operand[i32]] = None
----------------
rolfmorel wrote:
What happens when we do `= None` on a non-`Optional` field? That's an error right? Might be worth checking that an (appropriate) exception is raised.
https://github.com/llvm/llvm-project/pull/186574
More information about the Mlir-commits
mailing list