Fixes for bug#54388 "InternalsVisibleTo is case sensitive" * Fix the JIT so that...
[mono.git] / mcs / mcs / complete.cs
index 6eb42cddada0a51de2f96f54fe9c35b0b6cd294e..b1d2993256a517fc96483d5be1af20d2b09f332c 100644 (file)
@@ -114,32 +114,31 @@ namespace Mono.CSharp {
                        var sn = expr as SimpleName;
                        const ResolveFlags flags = ResolveFlags.VariableOrValue | ResolveFlags.Type;
 
-                       //
-                       // Resolve the expression with flow analysis turned off, we'll do the definite
-                       // assignment checks later.  This is because we don't know yet what the expression
-                       // will resolve to - it may resolve to a FieldExpr and in this case we must do the
-                       // definite assignment check on the actual field and not on the whole struct.
-                       //
-                       using (rc.Set (ResolveContext.Options.OmitStructFlowAnalysis)) {
-                               if (sn != null) {
+                       if (sn != null) {
+                               var errors_printer = new SessionReportPrinter ();
+                               var old = rc.Report.SetPrinter (errors_printer);
+                               try {
                                        expr = sn.LookupNameExpression (rc, MemberLookupRestrictions.ReadAccess | MemberLookupRestrictions.ExactArity);
+                               } finally {
+                                       rc.Report.SetPrinter (old);
+                               }
+
+                               if (errors_printer.ErrorsCount != 0)
+                                       return null;
 
-                                       //
-                                       // Resolve expression which does have type set as we need expression type
-                                       // with disable flow analysis as we don't know whether left side expression
-                                       // is used as variable or type
-                                       //
-                                       if (expr is VariableReference || expr is ConstantExpr || expr is Linq.TransparentMemberAccess) {
-                                               using (rc.With (ResolveContext.Options.DoFlowAnalysis, false)) {
-                                                       expr = expr.Resolve (rc);
-                                               }
-                                       } else if (expr is TypeParameterExpr) {
-                                               expr.Error_UnexpectedKind (rc, flags, sn.Location);
-                                               expr = null;
-                                       }
-                               } else {
-                                       expr = expr.Resolve (rc, flags);
+                               //
+                               // Resolve expression which does have type set as we need expression type
+                               // with disable flow analysis as we don't know whether left side expression
+                               // is used as variable or type
+                               //
+                               if (expr is VariableReference || expr is ConstantExpr || expr is Linq.TransparentMemberAccess) {
+                                       expr = expr.Resolve (rc);
+                               } else if (expr is TypeParameterExpr) {
+                                       expr.Error_UnexpectedKind (rc, flags, sn.Location);
+                                       expr = null;
                                }
+                       } else {
+                               expr = expr.Resolve (rc, flags);
                        }
 
                        if (expr == null)
@@ -152,19 +151,19 @@ namespace Mono.CSharp {
                        }
 
                        if (targs != null) {
-                               if (!targs.Resolve (rc))
+                               if (!targs.Resolve (rc, true))
                                        return null;
                        }
 
                        var results = new List<string> ();
-                       if (expr is Namespace) {
-                               Namespace nexpr = expr as Namespace;
+                       var nexpr = expr as NamespaceExpression;
+                       if (nexpr != null) {
                                string namespaced_partial;
 
                                if (partial_name == null)
-                                       namespaced_partial = nexpr.Name;
+                                       namespaced_partial = nexpr.Namespace.Name;
                                else
-                                       namespaced_partial = nexpr.Name + "." + partial_name;
+                                       namespaced_partial = nexpr.Namespace.Name + "." + partial_name;
 
                                rc.CurrentMemberDefinition.GetCompletionStartingWith (namespaced_partial, results);
                                if (partial_name != null)
@@ -220,5 +219,17 @@ namespace Mono.CSharp {
                        // Nothing
                }
        }
+
+       public class EmptyCompletion : CompletingExpression
+       {
+               protected override void CloneTo (CloneContext clonectx, Expression target)
+               {
+               }
+
+               protected override Expression DoResolve (ResolveContext rc)
+               {
+                       throw new CompletionResult ("", new string [0]);
+               }
+       }
        
 }