Example #1
0
        public System.Type GetBoundUnderlyingTypeOrThrow(SemanticTypeMask_I semanticType)
        {
            var boundType = GetBoundTypeOrThrow(semanticType, false);

            if (boundType.UnderlyingType == null)
            {
                throw new System.Exception("Expected the underlying type to be filled in with a instance of a runtime type.");
            }

            return(boundType.UnderlyingType);
        }
Example #2
0
 private static ExecutionTypeParameterDefinition_I CreateGenericParameter(SemanticTypeMask_I genericDeclaringType)
 {
     if (genericDeclaringType.IsConverted())
     {
         return(new ConvertedGenericParameterTypeDefinition());
     }
     else
     {
         return(new BoundGenericParameterTypeDefinition());
     }
 }
Example #3
0
        public void Add(SemanticTypeMask_I typeDefinitionEntry, SemanticTypeMask_I dependent)
        {
            //if (!typeDefinitionEntry.Dependencies.TryGetValue(dependent.ResolutionName(), out SemanticNodeBaseMask_I node1))
            //{
            //    typeDefinitionEntry.Dependencies.Add(dependent.ResolutionName(), dependent);
            //}

            //if (!dependent.Dependencies.TryGetValue(typeDefinitionEntry.ResolutionName(), out SemanticNodeBaseMask_I node2))
            //{
            //    dependent.Dependencies.Add(typeDefinitionEntry.ResolutionName(), typeDefinitionEntry);
            //}
        }
Example #4
0
        public BoundTypeDefinitionMask_I GetBoundTypeOrThrow(SemanticTypeMask_I semanticType, bool allowNulls)
        {
            if (semanticType == null)
            {
                if (allowNulls)
                {
                    return(null);
                }

                throw new System.Exception("The semantic type is null.");
            }


            if (!semanticType.IsBound())
            {
                throw new System.Exception("Expected any type in the conversion graph to be at least a bound type.");
            }

            return((BoundTypeDefinitionMask_I)semanticType);
        }
Example #5
0
        /// <summary>
        /// Ensures that all of the types that the method uses have been created so that when the methods is actually converted,
        /// no types have to be created.
        /// </summary>
        /// <param name="conversion"></param>
        /// <param name="boundTypeMask"></param>
        public void EnsureTypes(ILConversion conversion, SemanticTypeMask_I boundTypeMask)
        {
            if (!boundTypeMask.IsDefinition())
            {
                return;
            }

            var typeDefinitionMask = (BoundTypeDefinitionMask_I)boundTypeMask;

            var typeReference = typeDefinitionMask.SourceTypeReference;

            // Done on purpose to find errors
            var typeDefinition = Cecil.GetFundamentalTypeDefinition(typeReference);

            var methods = typeDefinition.Methods;

            for (int i = 0; i < methods.Count; i++)
            {
                var method = methods[i];
                EnsureTypes(conversion, method, typeReference);
            }
        }
Example #6
0
        public void EnsureTypes(ILConversion conversion, SemanticTypeMask_I boundTypeMask)
        {
            if (!boundTypeMask.IsDefinition())
            {
                return;
            }

            var typeDefinitionMask = (SemanticTypeDefinitionMask_I)boundTypeMask;

            var typeReference = typeDefinitionMask.SourceTypeReference;

            var typeDefinition = Cecil.GetFundamentalTypeDefinition(typeReference);

            var fields = typeDefinition.Fields;

            for (int i = 0; i < fields.Count; i++)
            {
                var field = fields[i];

                EnsureTypes(conversion, field, typeReference);
            }
        }
Example #7
0
 public BoundTypeDefinitionMask_I GetBoundTypeOrThrow(SemanticTypeMask_I semanticType, bool allowNulls)
 {
     return(Bound.Models.Types.GetBoundTypeOrThrow(semanticType, allowNulls));
 }
Example #8
0
 public System.Type GetBoundUnderlyingTypeOrThrow(SemanticTypeMask_I semanticType)
 {
     return(Bound.Models.Types.GetBoundUnderlyingTypeOrThrow(semanticType));
 }
Example #9
0
        public string GetResolutionName(SemanticTypeMask_I input)
        {
            var assemblyQualifiedName = input.AssemblyQualifiedName;

            return(Infrastructure.Structural.Naming.AdjustResolutionName(assemblyQualifiedName));
        }
Example #10
0
 public string GetResolutionName(SemanticTypeMask_I input)
 {
     return(Infrastructure.Semantic.Metadata.Members.Types.Naming.GetResolutionName(input));
 }
Example #11
0
 public string GetResolutionName(SemanticTypeMask_I input)
 {
     return(Bound.Metadata.Members.Types.Naming.GetResolutionName(input));
 }
Example #12
0
 public List <SemanticTypeMask_I> Calculate(SemanticTypeMask_I convertedModule, List <SemanticTypeMask_I> list)
 {
     throw new System.NotImplementedException();
 }