<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def predict_type(self):
 """ Traverse the ref_elements path and determine the component type being referenced. Also do some checks on the array indexes """

        current_comp = self.ref_root
        for name, array_suffixes, name_src_ref in self.ref_elements:

            # find instance
            current_comp = current_comp.get_child_by_name(name)
            if current_comp is None:
                # Not found!
                self.msg.fatal(
                    "Could not resolve hierarchical reference to '%s'" % name,
                    name_src_ref
                )

            # Do type-check in array suffixes
            for array_suffix in array_suffixes:
                array_suffix.predict_type()

            # Check array suffixes
            if (isinstance(current_comp, comp.AddressableComponent)) and current_comp.is_array:
                # is an array
                if len(array_suffixes) != len(current_comp.array_dimensions):
                    self.msg.fatal(
                        "Incompatible number of index dimensions after '%s'. Expected %d, found %d."
                        % (name, len(current_comp.array_dimensions), len(array_suffixes)),
                        name_src_ref
                    )
            elif array_suffixes:
                # Has array suffixes. Check if compatible with referenced component
                self.msg.fatal(
                    "Unable to index non-array component '%s'" % name,
                    name_src_ref
                )

        return type(current_comp)