[mcs] Moves using static lookup at the end of simple name lookup rules. Fixes #55348
[mono.git] / mcs / mcs / context.cs
index 7b5ffadf328884fdeaf5bc532468b005be5f98f2..24bccb69187473eb813014477e5d9c7db1f4ab81 100644 (file)
@@ -22,7 +22,8 @@ namespace Mono.CSharp
        {
                Normal = 0,
                Probing = 1,
-               IgnoreAccessibility = 2
+               IgnoreAccessibility = 2,
+               IgnoreStaticUsing = 1 << 10
        }
 
        //
@@ -116,6 +117,8 @@ namespace Mono.CSharp
 
                public ExceptionStatement CurrentTryBlock { get; set; }
 
+               public TryCatch CurrentTryCatch { get; set; }
+
                public LoopStatement EnclosingLoop { get; set; }
 
                public LoopStatement EnclosingLoopOrSwitch { get; set; }
@@ -524,6 +527,19 @@ namespace Mono.CSharp
                        return da;
                }
 
+               public Dictionary<Statement, List<DefiniteAssignmentBitSet>> CopyLabelStack ()
+               {
+                       if (LabelStack == null)
+                               return null;
+
+                       var dest = new Dictionary<Statement, List<DefiniteAssignmentBitSet>> ();
+                       foreach (var entry in LabelStack) {
+                               dest.Add (entry.Key, new List<DefiniteAssignmentBitSet> (entry.Value));
+                       }
+
+                       return dest;
+               }
+
                public bool IsDefinitelyAssigned (VariableInfo variable)
                {
                        return variable.IsAssigned (DefiniteAssignment);
@@ -534,6 +550,11 @@ namespace Mono.CSharp
                        return variable.IsStructFieldAssigned (DefiniteAssignment, name);
                }
 
+               public void SetLabelStack (Dictionary<Statement, List<DefiniteAssignmentBitSet>> labelStack)
+               {
+                       LabelStack = labelStack;
+               }
+
                public void SetVariableAssigned (VariableInfo variable, bool generatedAssignment = false)
                {
                        variable.SetAssigned (DefiniteAssignment, generatedAssignment);
@@ -654,13 +675,13 @@ namespace Mono.CSharp
                        if (all_source_files == null) {
                                all_source_files = new Dictionary<string, SourceFile> ();
                                foreach (var source in SourceFiles)
-                                       all_source_files[source.FullPathName] = source;
+                                       all_source_files[source.OriginalFullPathName] = source;
                        }
 
                        string path;
                        if (!Path.IsPathRooted (name)) {
                                var loc = comp_unit.SourceFile;
-                               string root = Path.GetDirectoryName (loc.FullPathName);
+                               string root = Path.GetDirectoryName (loc.OriginalFullPathName);
                                path = Path.GetFullPath (Path.Combine (root, name));
                                var dir = Path.GetDirectoryName (loc.Name);
                                if (!string.IsNullOrEmpty (dir))