Skip to content

Commit 5366394

Browse files
committed
Add case return_as_bytes to switches in detail/type_caster_base.h and eigen.h
Based on systematic review under #3838 (comment)
1 parent b06f71b commit 5366394

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

include/pybind11/detail/type_caster_base.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,9 @@ class type_caster_generic {
651651
keep_alive_impl(inst, parent);
652652
break;
653653

654+
case return_value_policy::return_as_bytes:
655+
pybind11_fail("return_value_policy::return_as_bytes does not apply.");
656+
654657
default:
655658
throw cast_error("unhandled return_value_policy: should not happen!");
656659
}

include/pybind11/eigen.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ struct type_caster<Type, enable_if_t<is_eigen_dense_plain<Type>::value>> {
349349
return eigen_ref_array<props>(*src);
350350
case return_value_policy::reference_internal:
351351
return eigen_ref_array<props>(*src, parent);
352+
case return_value_policy::return_as_bytes:
353+
pybind11_fail("return_value_policy::return_as_bytes does not apply.");
352354
default:
353355
throw cast_error("unhandled return_value_policy: should not happen!");
354356
};

0 commit comments

Comments
 (0)