using System.Text;
using System.Linq;
using Mono.CompilerServices.SymbolWriter;
+using System.Runtime.CompilerServices;
#if NET_2_1
using XmlElement = System.Object;
}
if (a.Type == pa.MethodImpl) {
- is_external_implementation = a.IsInternalCall ();
- }
+ if ((ModFlags & Modifiers.ASYNC) != 0 && (a.GetMethodImplOptions () & MethodImplOptions.Synchronized) != 0) {
+ Report.Error (4015, a.Location, "`{0}': Async methods cannot use `MethodImplOptions.Synchronized'",
+ GetSignatureForError ());
+ }
- if (a.Type == pa.DllImport) {
+ is_external_implementation = a.IsInternalCall ();
+ } else if (a.Type == pa.DllImport) {
const Modifiers extern_static = Modifiers.EXTERN | Modifiers.STATIC;
if ((ModFlags & extern_static) != extern_static) {
Report.Error (601, a.Location, "The DllImport attribute must be specified on a method marked `static' and `extern'");
if ((ModFlags & Modifiers.PARTIAL) != 0) {
for (int i = 0; i < parameters.Count; ++i) {
IParameterData p = parameters.FixedParameters [i];
- if (p.ModFlags == Parameter.Modifier.OUT) {
+ if ((p.ModFlags & Parameter.Modifier.OUT) != 0) {
Report.Error (752, Location, "`{0}': A partial method parameters cannot use `out' modifier",
GetSignatureForError ());
}
var ac = parameters.Types [0] as ArrayContainer;
return ac != null && ac.Rank == 1 && ac.Element.BuiltinType == BuiltinTypeSpec.Type.String &&
- (parameters[0].ModFlags & ~Parameter.Modifier.PARAMS) == Parameter.Modifier.NONE;
+ (parameters[0].ModFlags & Parameter.Modifier.RefOutMask) == 0;
}
public override FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)
}
for (int i = 0; i < parameters.Count; ++i) {
- if (parameters.FixedParameters [i].ModFlags == Parameter.Modifier.OUT) {
+ if ((parameters.FixedParameters [i].ModFlags & Parameter.Modifier.OUT) != 0) {
Report.Error (685, Location, "Conditional method `{0}' cannot have an out parameter", GetSignatureForError ());
return;
}
Report.Error (1983, Location, "The return type of an async method must be void, Task, or Task<T>");
}
- AsyncInitializer.Create (this, block, parameters, Parent.PartialContainer, ReturnType, Location);
+ block = (ToplevelBlock) block.ConvertToAsyncTask (this, Parent.PartialContainer, parameters, ReturnType, Location);
ModFlags |= Modifiers.DEBUGGER_HIDDEN;
}
}
return null;
}
+ public override string GetCallerMemberName ()
+ {
+ return IsStatic ? TypeConstructorName : ConstructorName;
+ }
+
public override string GetSignatureForDocumentation ()
{
return Parent.GetSignatureForDocumentation () + ".#ctor" + parameters.GetSignatureForDocumentation ();
}
}
- public bool IsExcluded ()
- {
- return false;
- }
-
public MemberName MethodName {
get {
return MemberName;
return false;
}
+ public override string GetCallerMemberName ()
+ {
+ return base.GetCallerMemberName ().Substring (prefix.Length);
+ }
+
public override string GetSignatureForDocumentation ()
{
// should not be called