[svn] r6813: nemerle/trunk/ncc: external/InternalTypes.n hierarchy/DelegateClassGen.n hierarchy/TypeBuilde...

nazgul svnadmin at nemerle.org
Mon Oct 30 17:37:40 CET 2006


Log:
Fix IsDelegate

Author: nazgul
Date: Mon Oct 30 17:37:32 2006
New Revision: 6813

Modified:
   nemerle/trunk/ncc/external/InternalTypes.n
   nemerle/trunk/ncc/hierarchy/DelegateClassGen.n
   nemerle/trunk/ncc/hierarchy/TypeBuilder.n
   nemerle/trunk/ncc/hierarchy/TypeInfo.n

Modified: nemerle/trunk/ncc/external/InternalTypes.n
==============================================================================
--- nemerle/trunk/ncc/external/InternalTypes.n	(original)
+++ nemerle/trunk/ncc/external/InternalTypes.n	Mon Oct 30 17:37:32 2006
@@ -374,6 +374,7 @@
   public mutable Char_tc : TypeInfo;
   public mutable Decimal_tc : TypeInfo;
   public mutable Delegate_tc : TypeInfo;
+  public mutable MulticastDelegate_tc : TypeInfo;  
   public mutable Double_tc : TypeInfo;
   public mutable Enum_tc : TypeInfo;
   public mutable Exception_tc : TypeInfo;
@@ -558,6 +559,7 @@
     Char_tc = lookup ("System.Char"); Char = MType.Class (Char_tc, []);
     Decimal_tc = lookup ("System.Decimal"); Decimal = MType.Class (Decimal_tc, []);
     Delegate_tc = lookup ("System.Delegate"); Delegate = MType.Class (Delegate_tc, []);
+    MulticastDelegate_tc = lookup ("System.MulticastDelegate");
     Double_tc = lookup ("System.Double"); Double = MType.Class (Double_tc, []);
     Enum_tc = lookup ("System.Enum"); Enum = MType.Class (Enum_tc, []);
     Exception_tc = lookup ("System.Exception"); Exception = MType.Class (Exception_tc, []);

Modified: nemerle/trunk/ncc/hierarchy/DelegateClassGen.n
==============================================================================
--- nemerle/trunk/ncc/hierarchy/DelegateClassGen.n	(original)
+++ nemerle/trunk/ncc/hierarchy/DelegateClassGen.n	Mon Oct 30 17:37:32 2006
@@ -80,7 +80,7 @@
             | parent => parent.DefineNestedType (pt_decl);
           };
 
-        td.MarkAsDeledate ();
+        td.MarkAsDelegate ();
         td.Compile ();
         td
       })

Modified: nemerle/trunk/ncc/hierarchy/TypeBuilder.n
==============================================================================
--- nemerle/trunk/ncc/hierarchy/TypeBuilder.n	(original)
+++ nemerle/trunk/ncc/hierarchy/TypeBuilder.n	Mon Oct 30 17:37:32 2006
@@ -89,7 +89,6 @@
   mutable instance_ctor_occured : bool;
   /// Marker for [TypeBuilder.Iter].
   internal mutable phase : int;
-  [Accessor (flags = Override)]
   mutable is_delegate : bool;
 
   public TyManager : TypesManager;
@@ -226,6 +225,16 @@
         }
   }
 
+  public override IsDelegate : bool
+  {  
+    get {
+     if (TyManager.run_phase <= 2)
+       is_delegate
+     else
+       InternalType.MulticastDelegate_tc.Equals (BaseType)
+    } 
+  }
+  
   public IsAlias : bool
   {
     get { if (TyManager.run_phase <= 2)
@@ -568,7 +577,7 @@
     attributes |= NemerleAttributes.SpecialName
   }
 
-  internal MarkAsDeledate () : void
+  internal MarkAsDelegate () : void
   {
     is_delegate = true;
     MarkWithSpecialName ();

Modified: nemerle/trunk/ncc/hierarchy/TypeInfo.n
==============================================================================
--- nemerle/trunk/ncc/hierarchy/TypeInfo.n	(original)
+++ nemerle/trunk/ncc/hierarchy/TypeInfo.n	Mon Oct 30 17:37:32 2006
@@ -410,7 +410,7 @@
 
   /** Compare types for equality. */
   public Equals (the_other : TypeInfo) : bool
-  { id == the_other.id }
+  { the_other != null && id == the_other.id }
 
   [Nemerle.OverrideObjectEquals]
   public Equals (t : IMember) : bool



More information about the svn mailing list