Skip to content

Commit

Permalink
fix type conversion when scope is a typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vipul-Cariappa authored and aaronj0 committed Nov 8, 2024
1 parent 47bfa16 commit 4d86bea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Converters.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,10 @@ bool CPyCppyy::InstanceConverter::SetArg(
CPPInstance* pyobj = GetCppInstance(pyobject);
if (pyobj) {
auto oisa = pyobj->ObjectIsA();
if (oisa && (oisa == fClass || Cppyy::IsSubclass(oisa, fClass))) {
if (oisa && ((oisa == (Cppyy::IsTypedefed(fClass)
? Cppyy::GetUnderlyingScope(fClass)
: fClass)) ||
Cppyy::IsSubclass(oisa, fClass))) {
// calculate offset between formal and actual arguments
para.fValue.fVoidp = pyobj->GetObject();
if (!para.fValue.fVoidp)
Expand Down

0 comments on commit 4d86bea

Please sign in to comment.