Fixed string null constant conversion to object constant
[mono.git] / mcs / mcs / namespace.cs
index a1cf4dcb7b6839ce2817ea8cacd91ec6473bfa71..f454b93498665cd1da1c66d74f2f4d03f96d42e9 100644 (file)
@@ -427,24 +427,6 @@ namespace Mono.CSharp {
                        return texpr;
                }
 
-               // TODO: REMOVE me
-               public ATypeNameExpression MakeTypeNameExpression (Location loc)
-               {
-                       string[] names = Name.Split (new[] { '.' });
-
-                       ATypeNameExpression exp = null;
-                       for (var i = 0; i < names.Length; i++) {
-                               var name = names[i];
-                               if (exp == null) {
-                                       exp = new SimpleName (name, loc);
-                               } else {
-                                       exp = new MemberAccess (exp, name, loc);
-                               }
-                       }
-
-                       return exp;
-               }
-
                //
                // Completes types with the given `prefix'
                //
@@ -839,9 +821,6 @@ namespace Mono.CSharp {
                        get {
                                return clauses;
                        }
-                       protected set {
-                               clauses = value;
-                       }
                }
 
                public override string[] ValidAttributeTargets {
@@ -852,7 +831,7 @@ namespace Mono.CSharp {
 
                #endregion
 
-               public void AddUsing (UsingNamespace un, bool forceAppend = false) // TODO: remove the change
+               public void AddUsing (UsingNamespace un)
                {
                        if (DeclarationFound){
                                Compiler.Report.Error (1529, un.Location, "A using clause must precede all other namespace elements except extern alias declarations");
@@ -901,10 +880,6 @@ namespace Mono.CSharp {
                public override void AddTypeContainer (TypeContainer tc)
                {
                        string name = tc.Basename;
-                       if (name == null) {
-                               containers.Add (tc);
-                               return;
-                       }
 
                        var mn = tc.MemberName;
                        while (mn.Left != null) {
@@ -917,7 +892,7 @@ namespace Mono.CSharp {
                        MemberCore mc;
                        if (names_container.DefinedNames.TryGetValue (name, out mc)) {
                                if (tc is NamespaceContainer && mc is NamespaceContainer) {
-                                       containers.Add (tc);
+                                       AddTypeContainerMember (tc);
                                        return;
                                }
 
@@ -1087,6 +1062,9 @@ namespace Mono.CSharp {
 
                public override void GetCompletionStartingWith (string prefix, List<string> results)
                {
+                       if (Usings == null)
+                               return;
+
                        foreach (var un in Usings) {
                                if (un.Alias != null)
                                        continue;
@@ -1162,7 +1140,7 @@ namespace Mono.CSharp {
                        if (aliases != null && arity == 0) {
                                UsingAliasNamespace uan;
                                if (aliases.TryGetValue (name, out uan)) {
-                                       if (fne != null) {
+                                       if (fne != null && mode != LookupMode.Probing) {
                                                // TODO: Namespace has broken location
                                                //Report.SymbolRelatedToPreviousError (fne.Location, null);
                                                Compiler.Report.SymbolRelatedToPreviousError (uan.Location, null);