Exemple #1
0
        private void fillData(GenericParameter limNode, ITypeParameterSymbol roslynNode, bool setHasMember)
        {
            limNode.GenericParameterKind = Types.GenericParameterKind.gpkType;

            foreach (var constraint in roslynNode.ConstraintTypes)
            {
                SyntaxNode _m;
                Lim.Asg.Nodes.Type.Type limTpye;
                if (!constraint.IsInMetadata())
                {
                    var original = constraint.GetDefinition(out _m);
                    if (original != null && original.Kind == constraint.Kind)
                    {
                        limTpye = original.GetLimType();
                    }
                    else
                    {
                        continue;
                    }
                }
                else
                {
                    limTpye = constraint.GetLimType();
                    MainDeclaration.Instance.LimFactory.setFiltered(limTpye.Id);
                }

                Commons.Common.Safe_Edge(limNode, "HasParameterConstraint", limTpye.Id);
            }


            Base limParent = roslynNode.Parent().ConvertToLimNode();

            if (limParent != null)
            {
                if (roslynNode.Parent().IsInMetadata())
                {
                    MainDeclaration.Instance.LimFactory.setFiltered(limParent.Id);
                }
                if (Lim.Asg.Common.getIsMethodGeneric(limParent))
                {
                    MethodGeneric methodGeneric = (MethodGeneric)limParent;
                    Commons.Common.Safe_Edge(methodGeneric, "HasGenericParameter", limNode.Id);
                }
                else if (Lim.Asg.Common.getIsClassGeneric(limParent))
                {
                    ClassGeneric clasGeneric = (ClassGeneric)limParent;
                    Commons.Common.Safe_Edge(clasGeneric, "HasGenericParameter", limNode.Id);
                }
            }
        }
Exemple #2
0
        private void fillData(MethodGeneric limNode, IMethodSymbol roslynNode, bool setHasMember)
        {
            #region hasGenericParameter

            foreach (var argument in roslynNode.TypeArguments)
            {
                Base genericParameter = argument.ConvertToLimNode();
                if (genericParameter == null)
                {
                    return;
                }
                FillData(genericParameter, argument, setHasMember);
            }

            #endregion hasGenericParameter

            fillData(limNode as Method, roslynNode, setHasMember);
        }