From 165a35c18c28d6feb5a7baead871b67678eac177 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Mon, 20 Jan 2014 09:22:17 -0500 Subject: [PATCH] Revert "Exclude more console code from NET_2_1" Since we no longer care about Moonlight, this patch is no longer needed, and enables some cute functionality on the iOS REPL. This reverts commit ec445c82f7b7cc86ec9e0c2e561e3f28dd4e57e2. --- mcs/mcs/eval.cs | 2 -- mcs/tools/monop/outline.cs | 22 ++++++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/mcs/mcs/eval.cs b/mcs/mcs/eval.cs index 3458f7499c9..766bb05696b 100644 --- a/mcs/mcs/eval.cs +++ b/mcs/mcs/eval.cs @@ -1046,9 +1046,7 @@ namespace Mono.CSharp static public string help { get { return "Static methods:\n" + -#if !NET_2_1 " Describe (object); - Describes the object's type\n" + -#endif " LoadPackage (package); - Loads the given Package (like -pkg:FILE)\n" + " LoadAssembly (assembly); - Loads the given assembly (like -r:ASSEMBLY)\n" + " ShowVars (); - Shows defined local variables.\n" + diff --git a/mcs/tools/monop/outline.cs b/mcs/tools/monop/outline.cs index 7f21b8c4dfb..1104b1c1169 100644 --- a/mcs/tools/monop/outline.cs +++ b/mcs/tools/monop/outline.cs @@ -29,8 +29,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if !NET_2_1 - using System; using System.Reflection; using System.Collections; @@ -90,7 +88,9 @@ public class Outline { OutlineParams (method.GetParameters ()); o.Write (")"); +#if NET_2_0 WriteGenericConstraints (t.GetGenericArguments ()); +#endif o.WriteLine (";"); return; @@ -119,9 +119,9 @@ public class Outline { if (underlyingType != typeof (int)) o.Write (" : {0}", FormatType (underlyingType)); } - +#if NET_2_0 WriteGenericConstraints (t.GetGenericArguments ()); - +#endif o.WriteLine (" {"); o.Indent++; @@ -396,11 +396,15 @@ public class Outline { } o.Write (mi.Name); +#if NET_2_0 o.Write (FormatGenericParams (mi.GetGenericArguments ())); +#endif o.Write (" ("); OutlineParams (mi.GetParameters ()); o.Write (")"); +#if NET_2_0 WriteGenericConstraints (mi.GetGenericArguments ()); +#endif o.Write (";"); } @@ -559,6 +563,7 @@ public class Outline { } } +#if NET_2_0 string FormatGenericParams (Type [] args) { StringBuilder sb = new StringBuilder (); @@ -574,6 +579,7 @@ public class Outline { sb.Append (">"); return sb.ToString (); } +#endif // TODO: fine tune this so that our output is less verbose. We need to figure // out a way to do this while not making things confusing. @@ -673,7 +679,9 @@ public class Outline { void GetTypeName (StringBuilder sb, Type t) { sb.Append (RemoveGenericArity (t.Name)); +#if NET_2_0 sb.Append (FormatGenericParams (t.GetGenericArguments ())); +#endif } string GetFullName (Type t) @@ -685,10 +693,12 @@ public class Outline { void GetFullName_recursed (StringBuilder sb, Type t, bool recursed) { +#if NET_2_0 if (t.IsGenericParameter) { sb.Append (t.Name); return; } +#endif if (t.DeclaringType != null) { GetFullName_recursed (sb, t.DeclaringType, true); @@ -706,6 +716,7 @@ public class Outline { GetTypeName (sb, t); } +#if NET_2_0 void WriteGenericConstraints (Type [] args) { @@ -761,6 +772,7 @@ public class Outline { } } } +#endif string OperatorFromName (string name) { @@ -1024,5 +1036,3 @@ public class Comparer : IComparer { } } } - -#endif \ No newline at end of file -- 2.25.1