Example #1
0
        public bool Equals(EcmaFormatRuntimeNamedTypeInfo other)
        {
            // RuntimeTypeInfo.Equals(object) is the one that encapsulates our unification strategy so defer to him.
            object otherAsObject = other;

            return(base.Equals(otherAsObject));
        }
Example #2
0
        internal static EcmaFormatRuntimeNamedTypeInfo GetRuntimeNamedTypeInfo(MetadataReader metadataReader, TypeDefinitionHandle typeDefHandle, RuntimeTypeHandle precomputedTypeHandle)
        {
            RuntimeTypeHandle typeHandle = precomputedTypeHandle;

            if (typeHandle.IsNull())
            {
                if (!ReflectionCoreExecution.ExecutionEnvironment.TryGetNamedTypeForMetadata(new QTypeDefinition(metadataReader, typeDefHandle), out typeHandle))
                {
                    typeHandle = default(RuntimeTypeHandle);
                }
            }
            UnificationKey key = new UnificationKey(metadataReader, typeDefHandle, typeHandle);

            EcmaFormatRuntimeNamedTypeInfo type = NamedTypeTable.Table.GetOrAdd(key);

            type.EstablishDebugName();
            return(type);
        }
Example #3
0
        //
        // For app-compat reasons, we need to make sure that only TypeInfo instance exists for a given semantic type. If you change this, you must change the way
        // RuntimeTypeInfo.Equals() is implemented.
        //
        internal static EcmaFormatRuntimeGenericParameterTypeInfoForTypes GetRuntimeGenericParameterTypeInfoForTypes(EcmaFormatRuntimeNamedTypeInfo typeOwner, GenericParameterHandle genericParameterHandle)
        {
            UnificationKey key = new UnificationKey(typeOwner.Reader, typeOwner.TypeDefinitionHandle, genericParameterHandle);
            EcmaFormatRuntimeGenericParameterTypeInfoForTypes type = GenericParameterTypeForTypesTable.Table.GetOrAdd(key);

            type.EstablishDebugName();
            return(type);
        }