Skip to content

Commit 4d86bea

Browse files
Vipul-Cariappaaaronj0
authored andcommitted
fix type conversion when scope is a typedefs
1 parent 47bfa16 commit 4d86bea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Converters.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,10 @@ bool CPyCppyy::InstanceConverter::SetArg(
20552055
CPPInstance* pyobj = GetCppInstance(pyobject);
20562056
if (pyobj) {
20572057
auto oisa = pyobj->ObjectIsA();
2058-
if (oisa && (oisa == fClass || Cppyy::IsSubclass(oisa, fClass))) {
2058+
if (oisa && ((oisa == (Cppyy::IsTypedefed(fClass)
2059+
? Cppyy::GetUnderlyingScope(fClass)
2060+
: fClass)) ||
2061+
Cppyy::IsSubclass(oisa, fClass))) {
20592062
// calculate offset between formal and actual arguments
20602063
para.fValue.fVoidp = pyobj->GetObject();
20612064
if (!para.fValue.fVoidp)

0 commit comments

Comments
 (0)