[svn] r6453: nemerle/trunk/ncc/hierarchy/TypeBuilder.n

nazgul svnadmin at nemerle.org
Thu Jul 20 22:28:35 CEST 2006


Log:
Mark explicitly implemented methods as new

Author: nazgul
Date: Thu Jul 20 22:28:26 2006
New Revision: 6453

Modified:
   nemerle/trunk/ncc/hierarchy/TypeBuilder.n

Modified: nemerle/trunk/ncc/hierarchy/TypeBuilder.n
==============================================================================
--- nemerle/trunk/ncc/hierarchy/TypeBuilder.n	(original)
+++ nemerle/trunk/ncc/hierarchy/TypeBuilder.n	Thu Jul 20 22:28:26 2006
@@ -2088,35 +2088,28 @@
 
             ManagerClass.Instance.MarkAsUsed (meth);
             
-            match (iface_methods.Get (member)) {
-              | Some (meths) =>
+            def partition_and_set (meths, methods_map) {
                 def (correct, notcorrect) = List.Partition (meths, is_correct);
                 match (correct) {
                   | [] =>
                     Message.FatalError ($"interface `$(ty.FullName)' does not contain method named"
                                         " `$member' with proper signature")
                   | [m] =>                
-                    iface_methods.Set (member, notcorrect);
+                  methods_map.Set (member, notcorrect);
                     m
                   | _ =>
                     Message.FatalError ($"interface `$(ty.FullName)' contains more then one method"
                                         " named `$member' with proper signature")
                 }
+            }
+            
+            match (iface_methods.Get (member)) {
+              | Some (meths) =>
+                partition_and_set (meths, iface_methods);
               | None =>
                 match (can_explicitly_impl_methods.Get (member)) {
                   | Some (meths) =>
-                    def (correct, notcorrect) = List.Partition (meths, is_correct);
-                    match (correct) {
-                      | [] =>
-                        Message.FatalError ($"interface `$(ty.FullName)' does not contain method named"
-                                            " `$member' with proper signature")
-                      | [m] =>                
-                        can_explicitly_impl_methods.Set (member, notcorrect);
-                        m
-                      | _ =>
-                        Message.FatalError ($"interface `$(ty.FullName)' contains more then one method"
-                                            " named `$member' with proper signature")
-                    }
+                    partition_and_set (meths, can_explicitly_impl_methods);
 
                   | _ => 
                     Message.FatalError ($ "no interface implemented by `$FullName' " 
@@ -2138,7 +2131,7 @@
            // we do it exactly here (not earlier in validity checks), because this
            // operation is invalid at source code level
            unless (meth.Attributes %&& NemerleAttributes.Virtual)
-             meth.Attributes |= NemerleAttributes.Sealed %| NemerleAttributes.Virtual;
+             meth.Attributes |= NemerleAttributes.Sealed %| NemerleAttributes.Virtual %| NemerleAttributes.New;
               
           foreach (mem in impl') ManagerClass.Instance.MarkAsUsed (mem);
 



More information about the svn mailing list