using System.Collections.Generic;
using System.IO;
-#if STATIC
-using IKVM.Reflection.Emit;
-#else
-using System.Reflection.Emit;
-#endif
-
namespace Mono.CSharp
{
public enum LookupMode
bool IsObsolete { get; }
bool IsUnsafe { get; }
bool IsStatic { get; }
- bool HasUnresolvedConstraints { get; }
string GetSignatureForError ();
- IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope);
+ ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity);
FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc);
FullNamedExpression LookupNamespaceAlias (string name);
}
{
FlowBranching current_flow_branching;
- TypeSpec return_type;
-
- /// <summary>
- /// The location where return has to jump to return the
- /// value
- /// </summary>
- public Label ReturnLabel; // TODO: It's emit dependant
-
- /// <summary>
- /// If we already defined the ReturnLabel
- /// </summary>
- public bool HasReturnLabel;
+ readonly TypeSpec return_type;
public int FlowOffset;
get { return current_flow_branching; }
}
+ public TypeSpec ReturnType {
+ get { return return_type; }
+ }
+
// <summary>
// Starts a new code branching. This inherits the state of all local
// variables and parameters from the current branching.
return branching;
}
+ public FlowBranchingAsync StartFlowBranching (AsyncInitializer asyncBody, FlowBranching parent)
+ {
+ var branching = new FlowBranchingAsync (parent, asyncBody);
+ current_flow_branching = branching;
+ return branching;
+ }
+
public FlowBranchingToplevel StartFlowBranching (ParametersBlock stmt, FlowBranching parent)
{
FlowBranchingToplevel branching = new FlowBranchingToplevel (parent, stmt);
current_flow_branching = current_flow_branching.Parent;
}
- //
- // This method is used during the Resolution phase to flag the
- // need to define the ReturnLabel
- //
+#if !STATIC
public void NeedReturnLabel ()
{
- if (!HasReturnLabel)
- HasReturnLabel = true;
- }
-
- public TypeSpec ReturnType {
- get { return return_type; }
}
+#endif
}
//
UsingInitializerScope = 1 << 12,
+ LockScope = 1 << 13,
+
/// <summary>
/// Whether control flow analysis is enabled
/// </summary>
get { return (flags & Options.DoFlowAnalysis) != 0; }
}
- public bool HasUnresolvedConstraints {
- get { return false; }
- }
-
public bool IsInProbingMode {
get {
return (flags & Options.ProbingMode) != 0;
return MemberContext.GetSignatureForError ();
}
- public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope)
+ public ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)
{
- return MemberContext.LookupExtensionMethod (extensionType, name, arity, ref scope);
+ return MemberContext.LookupExtensionMethod (extensionType, name, arity);
}
public FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)
/// </summary>
CheckedScope = 1 << 0,
- /// <summary>
- /// The constant check state is always set to `true' and cant be changed
- /// from the command line. The source code can change this setting with
- /// the `checked' and `unchecked' statements and expressions.
- /// </summary>
- ConstantCheckState = 1 << 1,
-
- AllCheckStateFlags = CheckedScope | ConstantCheckState,
-
OmitDebugInfo = 1 << 2,
- ConstructorScope = 1 << 3
+ ConstructorScope = 1 << 3,
+
+ AsyncBody = 1 << 4
}
// utility helper for CheckExpr, UnCheckExpr, Checked and Unchecked statements
}
}
- Options flags;
+ protected Options flags;
public bool HasSet (Options options)
{