2002-07-22 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Mon, 22 Jul 2002 23:39:43 +0000 (23:39 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 22 Jul 2002 23:39:43 +0000 (23:39 -0000)
* class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
but this is required to check for a method name being the same as
the containing class.

Handle this now.

svn path=/trunk/mcs/; revision=6040

mcs/mcs/ChangeLog
mcs/mcs/class.cs

index 30c93df5e597b7a57e9285c07b08efd332c406de..0bc1915446f42c586404bf4ecb7411cd63e0d2c7 100755 (executable)
@@ -1,3 +1,11 @@
+2002-07-22  Miguel de Icaza  <miguel@ximian.com>
+
+       * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
+       but this is required to check for a method name being the same as
+       the containing class.  
+
+       Handle this now.
+
 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * interface.cs: initialize variable.
index a5ddd1460b67eec6b589288dd02a02997f06da67..462396874498ff40fe11e514623463e04dd4d772 100755 (executable)
@@ -215,6 +215,9 @@ namespace Mono.CSharp {
                        if (value != null && (!(value is Method)))
                                return AdditionResult.NameExists;
 
+                       if (name == Basename)
+                               return AdditionResult.EnclosingClash;
+
                        if (methods == null)
                                methods = new ArrayList ();