Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10273

[DF] Detection of types not instantiatable by the interpreter has broken edge cases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • 6.22/02
    • None
    • RDataFrame
    • 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";
      }
      

      Attachments

        Activity

          People

            eguiraud Enrico Guiraud
            eguiraud Enrico Guiraud
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: