/// <summary>
        /// Creates a method symbol that can be used to describe an operator declaration.
        /// </summary>
        public static IMethodSymbol CreateOperatorSymbol(
            ImmutableArray <AttributeData> attributes,
            Accessibility accessibility,
            DeclarationModifiers modifiers,
            ITypeSymbol returnType,
            CodeGenerationOperatorKind operatorKind,
            ImmutableArray <IParameterSymbol> parameters,
            ImmutableArray <SyntaxNode> statements = default,
            ImmutableArray <AttributeData> returnTypeAttributes = default)
        {
            var expectedParameterCount = CodeGenerationOperatorSymbol.GetParameterCount(operatorKind);

            if (parameters.Length != expectedParameterCount)
            {
                var message = expectedParameterCount == 1 ?
                              WorkspacesResources.Invalid_number_of_parameters_for_unary_operator :
                              WorkspacesResources.Invalid_number_of_parameters_for_binary_operator;
                throw new ArgumentException(message, nameof(parameters));
            }

            var result = new CodeGenerationOperatorSymbol(null, attributes, accessibility, modifiers, returnType, operatorKind, parameters, returnTypeAttributes);

            CodeGenerationMethodInfo.Attach(result, modifiers.IsNew, modifiers.IsUnsafe, modifiers.IsPartial, modifiers.IsAsync, statements, handlesExpressions: default);
            return(result);
        }
        /// <summary>
        /// Creates a method symbol that can be used to describe an operator declaration.
        /// </summary>
        public static IMethodSymbol CreateOperatorSymbol(IList <AttributeData> attributes, Accessibility accessibility, SymbolModifiers modifiers, ITypeSymbol returnType, CodeGenerationOperatorKind operatorKind, IList <IParameterSymbol> parameters, IList <SyntaxNode> statements = null, IList <AttributeData> returnTypeAttributes = null)
        {
            int expectedParameterCount = CodeGenerationOperatorSymbol.GetParameterCount(operatorKind);

            if (parameters.Count != expectedParameterCount)
            {
                var message = expectedParameterCount == 1 ?
                              WorkspacesResources.InvalidParameterCountForUnaryOperator :
                              WorkspacesResources.InvalidParameterCountForBinaryOperator;
                throw new ArgumentException(message, "parameters");
            }

            var result = new CodeGenerationOperatorSymbol(null, attributes, accessibility, modifiers, returnType, operatorKind, parameters, returnTypeAttributes);

            CodeGenerationMethodInfo.Attach(result, modifiers.IsNew, modifiers.IsUnsafe, modifiers.IsPartial, modifiers.IsAsync, statements, handlesExpressions: null);
            return(result);
        }