public bool ContainsBoundGenericClosure()
 {
     foreach (var arg in ParameterLists.Last())
     {
         if (arg.TypeSpec.ContainsBoundGenericClosure())
         {
             return(true);
         }
     }
     return(ReturnTypeSpec.ContainsBoundGenericClosure());
 }
Exemplo n.º 2
0
        internal string ParametersToString()
        {
            var builder = new StringBuilder();
            var first   = true;

            foreach (var parm in ParameterLists.Last())
            {
                if (!first)
                {
                    builder.Append(", ");
                }
                else
                {
                    first = false;
                }
                // forms
                // public_name private_name: [inout] Type
                // public_name: [inout] Type
                // _ private_name: [inout] Type
                if (parm.PublicName == parm.PrivateName)
                {
                    builder.Append(parm.PublicName);
                }
                else if (parm.NameIsRequired)
                {
                    builder.Append(parm.PublicName).Append(" ").Append(parm.PrivateName);
                }
                else
                {
                    builder.Append("_ ").Append(parm.PrivateName);
                }
                builder.Append(": ");
                if (parm.IsInOut || parm.TypeSpec.IsInOut)
                {
                    builder.Append("inout ");
                }
                builder.Append(parm.TypeSpec);
            }
            return(builder.ToString());
        }
Exemplo n.º 3
0
 public static ParameterList Parameters(IEnumerable <EntityProperty> parameters)
 => ParameterLists.Create(
     parameters.Select(argument => Param(argument)).ToArray());
Exemplo n.º 4
0
 private static ParameterList GetParameterList(List <CSharpTypeMembers.Parameter> parameters)
 => Any(parameters)
         ? ParameterLists.Create(parameters.Select(parameter =>
                                                   new DevOps.Primitives.CSharp.Parameter(parameter.Name, parameter.Type, string.IsNullOrWhiteSpace(parameter.DefaultValue) ? null : new Expression(parameter.DefaultValue), GetMemberAttributeList(parameter.Attributes))).ToArray())
         : null;
Exemplo n.º 5
0
 public static ParameterList Create(XUnitTheory theory)
 => !Any(theory?.Parameters) ? null
     : ParameterLists.Create(
     GetParameters(theory.Parameters).ToArray());