diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 35f5c13ba3..d51a0c6fb2 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -494,7 +494,7 @@ class cpp_function : public function { std::string tname(t->name()); detail::clean_type_id(tname); if (detail::cpp_name_needs_typing_annotated(tname.c_str())) { - signature += "Annotated[Any, \"" + tname + "\"]"; + signature += "Annotated[Any, CppTypePybind11(\"" + tname + "\")]"; } else { signature += tname; }