MetadataClassDescriptor GetMetadataClassDescriptor(SimplTypesScope metadataTScope)
        {
            MetadataClassDescriptor metadataCd = this.metadataClassDescriptor;

            if (metadataCd == null)
            {
                //this.InheritMetaMetadata(null); //edit

                String metadataClassSimpleName = this.GetMetadataClassSimpleName();
                // first look up by simple name, since package names for some built-ins are wrong

                metadataCd =
                    (MetadataClassDescriptor)metadataTScope.GetClassDescriptorBySimpleName(metadataClassSimpleName);
                if (metadataCd == null)
                {
                    String metadataClassName = this.GetMetadataClassName();

                    metadataCd = (MetadataClassDescriptor)metadataTScope.GetClassDescriptorByClassName(metadataClassName);
                    if (metadataCd == null)
                    {
                        try
                        {
                            Type metadataType = Type.GetType(metadataClassName) ??
                                                Type.GetType(metadataClassName +
                                                             AsemblyQualifiedNameForGeneratedSemantics);
                            this.metadataClass = metadataType;
                            if (MetadataClass != null)
                            {
                                metadataCd = (MetadataClassDescriptor)ClassDescriptor.GetClassDescriptor(MetadataClass);
                                metadataTScope.AddTranslation(MetadataClass);
                            }
                            else
                            {
                                Debug.WriteLineIf(BigSemanticsSettings.DebugLevel > 5, "Cannot find metadata class " + metadataClassName + " for " + this);
                            }
                        }
                        catch (Exception e)
                        {
                            Debug.WriteLine("Exception: " + e.Message);
                            Debug.WriteLine("Stacktrace:\n" + e.StackTrace);
                            Debug.WriteLine("Cannot find metadata class " + metadataClassName + " for " + this);
                        }
                    }
                }
            }
            return(metadataCd);
        }