/// <summary>
 /// Default ctor
 /// </summary>
 private XSyntheticMethodDefinition(XTypeDefinition declaringType, XSyntheticMethodFlags flags, string name, XTypeReference returnType, params XParameter[] parameters)
     : base(declaringType)
 {
     this.flags      = flags;
     this.name       = name;
     this.returnType = returnType;
     this.parameters = parameters.ToList();
     astParameters   = parameters.Select(x => new AstParameterVariable(x)).Cast <AstVariable>().ToList();
 }
        /// <summary>
        /// Create a synthetic method and add it to the given declaring type.
        /// </summary>
        public static XSyntheticMethodDefinition Create(XTypeDefinition declaringType, XSyntheticMethodFlags flags, string name, string scopeId, XTypeReference returnType, params XParameter[] parameters)
        {
            var method = new XSyntheticMethodDefinition(declaringType, flags, name, scopeId, returnType, parameters);

            declaringType.Add(method);
            return(method);
        }