Esempio n. 1
0
        /// <summary>
        /// Applies the rule.
        /// </summary>
        /// <param name="node">The node instance to modify.</param>
        /// <param name="data">Private data from CheckConsistency().</param>
        public override void Apply(IProcedureFeature node, object data)
        {
            IClass     EmbeddingClass = node.EmbeddingClass;
            ITypeName  BaseTypeName   = EmbeddingClass.ResolvedClassTypeName.Item;
            IClassType BaseType       = EmbeddingClass.ResolvedClassType.Item;

            IList <ICommandOverloadType> OverloadList = new List <ICommandOverloadType>();

            foreach (ICommandOverload Item in node.OverloadList)
            {
                OverloadList.Add(Item.ResolvedAssociatedType.Item);
            }

            ProcedureType.ResolveType(EmbeddingClass.TypeTable, BaseTypeName, BaseType.SourceType, BaseType, OverloadList, out ITypeName ResolvedProcedureTypeName, out IProcedureType ResolvedProcedureType);
            node.ResolvedAgentTypeName.Item = ResolvedProcedureTypeName;
            node.ResolvedAgentType.Item     = ResolvedProcedureType;

            node.ResolvedFeature.Item = node;

#if COVERAGE
            string TypeString = ResolvedProcedureType.ToString();
            Debug.Assert(!node.ResolvedEffectiveTypeName.IsAssigned);
            Debug.Assert(!node.ResolvedEffectiveType.IsAssigned);
#endif
        }
        /// <summary>
        /// Applies the rule.
        /// </summary>
        /// <param name="node">The node instance to modify.</param>
        /// <param name="data">Private data from CheckConsistency().</param>
        public override void Apply(IProcedureType node, object data)
        {
            IClass      EmbeddingClass = node.EmbeddingClass;
            IObjectType BaseType       = (IObjectType)node.BaseType;
            ITypeName   BaseTypeName   = BaseType.ResolvedTypeName.Item;
            ICompiledTypeWithFeature ResolvedBaseType = BaseType.ResolvedType.Item as ICompiledTypeWithFeature;

            Debug.Assert(BaseType != null);

            ProcedureType.ResolveType(EmbeddingClass.TypeTable, BaseTypeName, BaseType, ResolvedBaseType, node.OverloadList, out ITypeName ResolvedTypeName, out IProcedureType ResolvedType);
            node.ResolvedTypeName.Item = ResolvedTypeName;
            node.ResolvedType.Item     = ResolvedType;
        }