protected DelegateMethodSymbol(
                SourceNamedTypeSymbol containingType,
                string name,
                DelegateDeclarationSyntax syntax,
                MethodKind methodKind,
                DeclarationModifiers declarationModifiers,
                Binder binder,
                DiagnosticBag diagnostics,
                CancellationToken cancellationToken)
                : base(containingType, name, binder.GetSyntaxReference(syntax), blockSyntax: null, location: binder.Location(syntax.Identifier))
            {
                var location = this.locations[0];

                bool isExtensionMethod;

                this.parameters = MakeParameters(binder, syntax, out isExtensionMethod, out this.isVararg, diagnostics, cancellationToken);
                this.returnType = MakeReturnType(binder, syntax, diagnostics);
                this.flags      = MakeFlags(methodKind, declarationModifiers, IsVoidType(this.returnType), isExtensionMethod: isExtensionMethod);

                var info = ModifierUtils.CheckAccessibility(this.DeclarationModifiers);

                if (info != null)
                {
                    diagnostics.Add(info, location);
                }
            }
            protected DelegateMethodSymbol(
                SourceNamedTypeSymbol containingType,
                DelegateDeclarationSyntax syntax,
                MethodKind methodKind,
                DeclarationModifiers declarationModifiers,
                Binder binder,
                DiagnosticBag diagnostics)
                : base(containingType, binder.GetSyntaxReference(syntax), blockSyntaxReference: null, location: binder.Location(syntax.Identifier))
            {
                this.parameters = MakeParameters(binder, syntax, diagnostics);
                this.returnType = MakeReturnType(binder, syntax, diagnostics);
                this.flags = MakeFlags(methodKind, declarationModifiers, this.returnType.SpecialType == SpecialType.System_Void, isExtensionMethod: false);

                var info = ModifierUtils.CheckAccessibility(this.DeclarationModifiers);
                if (info != null)
                {
                    diagnostics.Add(info, this.locations[0]);
                }
            }
Beispiel #3
0
            protected DelegateMethodSymbol(
                SourceNamedTypeSymbol containingType,
                DelegateDeclarationSyntax syntax,
                MethodKind methodKind,
                DeclarationModifiers declarationModifiers,
                Binder binder,
                DiagnosticBag diagnostics)
                : base(containingType, binder.GetSyntaxReference(syntax), blockSyntaxReference: null, location: binder.Location(syntax.Identifier))
            {
                this.parameters = MakeParameters(binder, syntax, diagnostics);
                this.returnType = MakeReturnType(binder, syntax, diagnostics);
                this.flags      = MakeFlags(methodKind, declarationModifiers, this.returnType.SpecialType == SpecialType.System_Void, isExtensionMethod: false);

                var info = ModifierUtils.CheckAccessibility(this.DeclarationModifiers);

                if (info != null)
                {
                    diagnostics.Add(info, this.locations[0]);
                }
            }
            protected DelegateMethodSymbol(
                SourceNamedTypeSymbol containingType,
                string name,
                DelegateDeclarationSyntax syntax,
                MethodKind methodKind,
                DeclarationModifiers declarationModifiers,
                Binder binder,
                DiagnosticBag diagnostics,
                CancellationToken cancellationToken)
                : base(containingType, name, binder.GetSyntaxReference(syntax), blockSyntax: null, location: binder.Location(syntax.Identifier))
            {
                var location = this.locations[0];

                bool isExtensionMethod;
                this.parameters = MakeParameters(binder, syntax, out isExtensionMethod, out this.isVararg, diagnostics, cancellationToken);
                this.returnType = MakeReturnType(binder, syntax, diagnostics);
                this.flags = MakeFlags(methodKind, declarationModifiers, IsVoidType(this.returnType), isExtensionMethod: isExtensionMethod);

                var info = ModifierUtils.CheckAccessibility(this.DeclarationModifiers);
                if (info != null)
                {
                    diagnostics.Add(info, location);
                }
            }