Details
-
Bug
-
Resolution: Fixed
-
High
-
None
-
None
-
any
Description
First reported on the forum here.
The problem is that in RInterface::DefineImpl we take the output of TypeID2TypeName as an indicator of whether a given type is known to the interpreter or not. In some cases, e.g. vector<UnknownType>, TClass::GetClass and therefore TypeID2TypeName return the name of the type even if it's not instantiatable by the interpreter.
DefineImpl should further check the type_info. Philippe suggests the following logic:
std::string CheckTypeID(const std::type_info &t) {
|
int err = 0;
|
char* demangled_name = TClassEdit::DemangleTypeIdName(t, err);
|
if (err) return "Unknown typeid";
|
ClassInfo_t *info = gInterpreter->ClassInfo_Factory(demangled_name);
|
if ( info && gInterpreter->ClassInfo_IsValid(info) )
|
return gInterpreter->ClassInfo_FullName(info);
|
else
|
return "Unknown typeid";
|
}
|