diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp index dda4a027f0a30..7f34343eba6c9 100644 --- a/mlir/lib/Bindings/Python/IRCore.cpp +++ b/mlir/lib/Bindings/Python/IRCore.cpp @@ -1671,7 +1671,7 @@ nb::object PyOpView::buildGeneric( int segmentSpec = operandSegmentSpec[i]; if (segmentSpec == 1 || segmentSpec == 0) { // Unpack unary element. - const auto operand = operandList[i]; + const nanobind::handle operand = operandList[i]; if (!operand.is_none()) { try { operands.push_back(getOpResultOrValue(operand));