2007-02-23 Nagappan A <anagappan@novell.com>
[mono.git] / mcs / tools / monop / outline.cs
index d37e22ac4e255e268155f868fac879f6936601e0..35f1e4fb99cd3079c853e593c2ab50486c7607e3 100644 (file)
@@ -80,12 +80,13 @@ public class Outline {
                        o.Write (GetTypeName (t));
                        o.Write (" (");
                        OutlineParams (method.GetParameters ());
-                       o.WriteLine (")");
+                       o.Write (")");
 
 #if NET_2_0
                        WriteGenericConstraints (t.GetGenericArguments ());
 #endif                 
-
+       
+                       o.WriteLine (";"); 
                        return;
                }
                
@@ -473,6 +474,27 @@ public class Outline {
        {
                if (method.IsStatic)
                        return "static ";
+
+               if (method.IsFinal) {
+                       // This will happen if you have
+                       // class X : IA {
+                       //   public void A () {}
+                       //   static void Main () {}
+                       // }
+                       // interface IA {
+                       //   void A ();
+                       // }
+                       //
+                       // A needs to be virtual (the CLR requires
+                       // methods implementing an iface be virtual),
+                       // but can not be inherited. It also can not
+                       // be inherited. In C# this is represented
+                       // with no special modifiers
+
+                       if (method.IsVirtual)
+                               return null;
+                       return "sealed ";
+               }
                
                // all interface methods are "virtual" but we don't say that in c#
                if (method.IsVirtual && !method.DeclaringType.IsInterface) {
@@ -678,7 +700,7 @@ public class Outline {
                        GenericParameterAttributes attrs = t.GenericParameterAttributes & GenericParameterAttributes.SpecialConstraintMask;
                        GenericParameterAttributes [] interesting = {
                                GenericParameterAttributes.ReferenceTypeConstraint,
-                               GenericParameterAttributes.ValueTypeConstraint,
+                               GenericParameterAttributes.NotNullableValueTypeConstraint,
                                GenericParameterAttributes.DefaultConstructorConstraint
                        };
                        
@@ -713,7 +735,7 @@ public class Outline {
                                case GenericParameterAttributes.ReferenceTypeConstraint:
                                        o.Write ("class");
                                        break;
-                               case GenericParameterAttributes.ValueTypeConstraint:
+                               case GenericParameterAttributes.NotNullableValueTypeConstraint:
                                        o.Write ("struct");
                                        break;
                                case GenericParameterAttributes.DefaultConstructorConstraint:
@@ -783,6 +805,9 @@ public class Outline {
                
                if (options.ShowPrivate)
                        return true;
+
+               if (options.FilterObsolete && mi.IsDefined (typeof (ObsoleteAttribute), false))
+                       return false;
                
                switch (mi.MemberType) {
                case MemberTypes.Constructor: