class Reference(object):
    """
    The basic reference type
    """

    def __init__(self, type):
        super().__init__()
        self._type = type
        
    @property
    def type(self):
        """
        Returns the name of the type of the entity being referenced
        """
        return self._type


class ElementReference(Reference):
    """
    Describes a reference to an element, that is, a pair of references.

    Examples:
        - Member of an object instance
        - Method of a type
    """
    def __init__(self, thing, element, local=None):
        super(ElementReference, self).__init__(element.type)
        self.thing, self.element, self.local = thing, element, local

    @property
    def thing_index(self) -> int:
        """
        Returns the index of the thing being referenced
        """
        return self.thing.index

    @property
    def element_index(self) -> int:
        """
        Returns the relative index of the element being referenced
        """
        return self.element.index

    @property
    def local_index(self) -> int:
        """
        Returns the relative index of the local entity being referenced, if such a local entity exists
        """
        return self.local.index

    @property
    def is_local(self) -> bool:
        """
        Returns whether this reference also refers to a local element.
        """
        return self.local is not None

    @property
    def convention(self):
        """
        Returns the calling convention of this element, if it is a method call
        :return:
        """
        return self.element.convention

    @property
    def static(self) -> bool:
        """
        Returns whether the element is static
        """
        return self.element.static

    @property
    def kind(self) -> object:
        return self.element.kind

    def __str__(self):
        return f'EM({self.thing}.{self.element})'


class LocalReference(Reference):
    """
    Describes a reference to a local entity on a method's stack frame
    """
    def __init__(self, local):
        super(LocalReference, self).__init__(local.type)
        self.local = local

    @property
    def local_index(self) -> int:
        """
        Returns the index of the local element
        """
        return self.local.index

@@ -1860,18 +1860,19 @@
   def __
-st
+rep
 r__(self
@@ -2073,16 +2073,22 @@
 f, local
+, name
 ):%0A     
@@ -2161,24 +2161,49 @@
 ocal = local
+%0A        self.name = name
 %0A%0A    @prope
@@ -2303,32 +2303,32 @@
 ent%0A        %22%22%22%0A
-
         return s
@@ -2323,28 +2323,99 @@
     return self.local.index%0A
+%0A    def __repr__(self):%0A        return f'LR(%7Bself.type%7D %7Bself.name%7D)'%0A

Fix output of Reference objects