Merge pull request #409 from Alkarex/patch-1
[mono.git] / mcs / mcs / context.cs
index 7192d305db6a0a7e6313805a831c1ac04e1cec96..c06c1c478a8e849a4c59fb1bcc777f76c1ffa382 100644 (file)
@@ -95,6 +95,18 @@ namespace Mono.CSharp
 
                        if (rc.HasSet (ResolveContext.Options.CheckedScope))
                                flags |= ResolveContext.Options.CheckedScope;
+
+                       if (rc.IsInProbingMode)
+                               flags |= ResolveContext.Options.ProbingMode;
+
+                       if (rc.HasSet (ResolveContext.Options.FieldInitializerScope))
+                               flags |= ResolveContext.Options.FieldInitializerScope;
+
+                       if (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion))
+                               flags |= ResolveContext.Options.ExpressionTreeConversion;
+
+                       if (rc.HasSet (ResolveContext.Options.BaseInitializer))
+                               flags |= ResolveContext.Options.BaseInitializer;
                }
 
                public override FlowBranching CurrentBranching {
@@ -105,6 +117,24 @@ namespace Mono.CSharp
                        get { return return_type; }
                }
 
+               public bool IsUnreachable {
+                       get {
+                               return HasSet (Options.UnreachableScope);
+                       }
+                       set {
+                               flags = value ? flags | Options.UnreachableScope : flags & ~Options.UnreachableScope;
+                       }
+               }
+
+               public bool UnreachableReported {
+                       get {
+                               return HasSet (Options.UnreachableReported);
+                       }
+                       set {
+                               flags = value ? flags | Options.UnreachableReported : flags & ~Options.UnreachableScope;
+                       }
+               }
+
                // <summary>
                //   Starts a new code branching.  This inherits the state of all local
                //   variables and parameters from the current branching.
@@ -257,6 +287,10 @@ namespace Mono.CSharp
 
                        LockScope = 1 << 13,
 
+                       UnreachableScope = 1 << 14,
+
+                       UnreachableReported = 1 << 15,
+
                        /// <summary>
                        ///   Whether control flow analysis is enabled
                        /// </summary>