Author: lluis
Date: 2007-07-12 14:51:46 -0400 (Thu, 12 Jul 2007)
New Revision: 81891

Modified:
   trunk/monodevelop/Extras/CSharpBinding/ChangeLog
   trunk/monodevelop/Extras/CSharpBinding/Parser/Resolver.cs
Log:
* Parser/Resolver.cs: Properly resolve type names qualified with a
  namespace alias. Fixes bug #81999.

Modified: trunk/monodevelop/Extras/CSharpBinding/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/CSharpBinding/ChangeLog    2007-07-12 18:21:36 UTC 
(rev 81890)
+++ trunk/monodevelop/Extras/CSharpBinding/ChangeLog    2007-07-12 18:51:46 UTC 
(rev 81891)
@@ -1,3 +1,8 @@
+2007-07-12  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
+
+       * Parser/Resolver.cs: Properly resolve type names qualified with a
+         namespace alias. Fixes bug #81999.
+
 2007-07-12  Jeffrey Stedfast  <[EMAIL PROTECTED]>
 
        * FormattingStrategy/CSharpIndentEngine.cs (PushNewLine): If we

Modified: trunk/monodevelop/Extras/CSharpBinding/Parser/Resolver.cs
===================================================================
--- trunk/monodevelop/Extras/CSharpBinding/Parser/Resolver.cs   2007-07-12 
18:21:36 UTC (rev 81890)
+++ trunk/monodevelop/Extras/CSharpBinding/Parser/Resolver.cs   2007-07-12 
18:51:46 UTC (rev 81891)
@@ -889,11 +889,23 @@
                        
                        // If the name matches an alias, try using the alias 
first.
                        if (unit != null) {
-                               string aliasResult = FindAlias (name, unit);
+                               string aname;
+                               string apostfix;
+                               
+                               // If the type name has a namespace name, try 
to find an alias for the namespace
+                               int i = name.IndexOf ('.');
+                               if (i != -1) {
+                                       aname = name.Substring (0,i);
+                                       apostfix = name.Substring (i);
+                               } else {
+                                       aname = name;
+                                       apostfix = string.Empty;
+                               }
+                               string aliasResult = FindAlias (aname, unit);
                                if (aliasResult != null) {
                                        // Don't provide the compilation unit 
when trying to resolve the alias,
                                        // since aliases are not affected by 
other 'using' directives.
-                                       c = SearchType (aliasResult, 
genericArguments, null);
+                                       c = SearchType (aliasResult + apostfix, 
genericArguments, null);
                                        if (c != null)
                                                return c;
                                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to