[llvm] [mlir] [MLIR][Python] reland (narrower) type stub generation (PR #157930)

Maksim Levental via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 22 08:37:19 PDT 2025


makslevental wrote:

> /llvm-project/mlir/lib/Bindings/Python/IRModule.h:83:12: error: no viable conversion from returned value of type 'typename std::remove_reference<object &>::type' (aka 'nanobind::object') to function return type 'nanobind::typed<nanobind::object, PyOperation>'
>    83 |     return stolen;
>       |            ^~~~~~
> ```
> 
> I'm not super sure about. I have dealt with nanobind before, but unsure how it's being used here and how bazel build files need to updated.
> 
> So any tips on how I could go about fixing it would be appreciated!

`nb::typed<object,...>` is just an alias (effectively) for `object` - you can see at the bottom of the description here:

https://nanobind.readthedocs.io/en/latest/api_core.html#_CPPv4I0DpEN8nanobind5typedE

I don't know how it could be failed in bazel but not CMake but you guys have some different slicing/dicing/linking of the files.

https://github.com/llvm/llvm-project/pull/157930


More information about the llvm-commits mailing list