@@ -1550,8 +1550,8 @@ nb::typed<nb::object, PyOpView> PyOperation::createOpView() {
15501550  auto  operationCls = PyGlobals::get ().lookupOperationClass (
15511551      StringRef (identStr.data , identStr.length ));
15521552  if  (operationCls)
1553-     return  PyOpView::constructDerived (*operationCls, getRef ().getObject ());
1554-   return  nb::cast (PyOpView (getRef ().getObject ()));
1553+     return  nanobind::cast<nanobind::typed<nanobind::object,  PyOpView>>( PyOpView ::constructDerived (*operationCls, getRef ().getObject () ));
1554+   return  nanobind::cast<nanobind::typed<nanobind::object, PyOpView>>( nb::cast (PyOpView (getRef ().getObject () )));
15551555}
15561556
15571557void  PyOperation::erase () {
@@ -2143,8 +2143,8 @@ nb::typed<nb::object, PyAttribute> PyAttribute::maybeDownCast() {
21432143  //  contents into a new instance that will be owned by Python.
21442144  nb::object thisObj = nb::cast (this , nb::rv_policy::move);
21452145  if  (!typeCaster)
2146-     return  thisObj;
2147-   return  typeCaster.value ()(thisObj);
2146+     return  nanobind::cast<nanobind::typed<nanobind::object, PyAttribute>>( thisObj) ;
2147+   return  nanobind::cast<nanobind::typed<nanobind::object, PyAttribute>>( typeCaster.value ()(thisObj) );
21482148}
21492149
21502150// ------------------------------------------------------------------------------
@@ -2189,8 +2189,8 @@ nb::typed<nb::object, PyType> PyType::maybeDownCast() {
21892189  //  contents into a new instance that will be owned by Python.
21902190  nb::object thisObj = nb::cast (this , nb::rv_policy::move);
21912191  if  (!typeCaster)
2192-     return  thisObj;
2193-   return  typeCaster.value ()(thisObj);
2192+     return  nanobind::cast<nanobind::typed<nanobind::object, PyType>>( thisObj) ;
2193+   return  nanobind::cast<nanobind::typed<nanobind::object, PyType>>( typeCaster.value ()(thisObj) );
21942194}
21952195
21962196// ------------------------------------------------------------------------------
@@ -2230,8 +2230,8 @@ nanobind::typed<nanobind::object, PyValue> PyValue::maybeDownCast() {
22302230  //  contents into a new instance that will be owned by Python.
22312231  nb::object thisObj = nb::cast (this , nb::rv_policy::move);
22322232  if  (!valueCaster)
2233-     return  thisObj;
2234-   return  valueCaster.value ()(thisObj);
2233+     return  nanobind::cast<nanobind::typed<nanobind::object, PyValue>>( thisObj) ;
2234+   return  nanobind::cast<nanobind::typed<nanobind::object, PyValue>>( valueCaster.value ()(thisObj) );
22352235}
22362236
22372237PyValue PyValue::createFromCapsule (nb::object capsule) {
0 commit comments