Fix unmanaged type check for nested generic types
[mono.git] / mcs / mcs / report.cs
index 3138ab376dcff9800488ce2749940cc324b95283..81561a5cb9b387d48df82648e7b83e7b028c09ab 100644 (file)
@@ -2,9 +2,10 @@
 // report.cs: report errors and warnings.
 //
 // Author: Miguel de Icaza (miguel@ximian.com)
-//         Marek Safar (marek.safar@seznam.cz)         
+//         Marek Safar (marek.safar@gmail.com)         
 //
 // Copyright 2001 Ximian, Inc. (http://www.ximian.com)
+// Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
 //
 
 using System;
@@ -27,8 +28,6 @@ namespace Mono.CSharp {
                List<int> warnings_as_error;
                List<int> warnings_only;
 
-               public static int DebugFlags = 0;
-
                public const int RuntimeErrorId = 10000;
 
                //
@@ -56,15 +55,15 @@ namespace Mono.CSharp {
                        28, 67, 78,
                        105, 108, 109, 114, 162, 164, 168, 169, 183, 184, 197,
                        219, 251, 252, 253, 278, 282,
-                       402, 414, 419, 420, 429, 436, 440, 458, 464, 465, 467, 469, 472,
-                       612, 618, 626, 628, 642, 649, 652, 658, 659, 660, 661, 665, 672, 675, 693,
+                       402, 414, 419, 420, 429, 436, 437, 440, 458, 464, 465, 467, 469, 472, 473,
+                       612, 618, 626, 628, 642, 649, 652, 657, 658, 659, 660, 661, 665, 672, 675, 693,
                        728,
                        809, 824,
-                       1030, 1058, 1066,
+                       1030, 1058, 1060, 1066,
                        1522, 1570, 1571, 1572, 1573, 1574, 1580, 1581, 1584, 1587, 1589, 1590, 1591, 1592,
                        1607, 1616, 1633, 1634, 1635, 1685, 1690, 1691, 1692, 1695, 1696, 1699,
-                       1700, 1701, 1702, 1709, 1717, 1718, 1720,
-                       1901, 1981,
+                       1700, 1701, 1702, 1709, 1711, 1717, 1718, 1720, 1735,
+                       1901, 1956, 1981, 1998,
                        2002, 2023, 2029,
                        3000, 3001, 3002, 3003, 3005, 3006, 3007, 3008, 3009,
                        3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019,
@@ -105,6 +104,12 @@ namespace Mono.CSharp {
                        case LanguageVersion.V_3:
                                version = "3.0";
                                break;
+                       case LanguageVersion.V_4:
+                               version = "4.0";
+                               break;
+                       case LanguageVersion.V_5:
+                               version = "5.0";
+                               break;
                        default:
                                throw new InternalErrorException ("Invalid feature version", compiler.Settings.Version);
                        }
@@ -448,8 +453,8 @@ namespace Mono.CSharp {
                [Conditional ("MCS_DEBUG")]
                static public void Debug (int category, string message, params object[] args)
                {
-                       if ((category & DebugFlags) == 0)
-                               return;
+//                     if ((category & DebugFlags) == 0)
+//                             return;
 
                        StringBuilder sb = new StringBuilder (message);
 
@@ -679,6 +684,10 @@ namespace Mono.CSharp {
                }
        }
 
+       sealed class NullReportPrinter : ReportPrinter
+       {
+       }
+
        //
        // Default message recorder, it uses two types of message groups.
        // Common messages: messages reported in all sessions.
@@ -829,6 +838,7 @@ namespace Mono.CSharp {
                                break;
 
                        case "xterm-color":
+                       case "xterm-256color":
                                xterm_colors = true;
                                break;
                        }
@@ -989,7 +999,7 @@ namespace Mono.CSharp {
                        ReferencesImporting,
                        PredefinedTypesInit,
                        ModuleDefinitionTotal,
-                       UsingVerification,
+                       UsingResolve,
                        EmitTotal,
                        CloseTypes,
                        Resouces,
@@ -1048,7 +1058,7 @@ namespace Mono.CSharp {
                                { TimerType.ReferencesImporting, "Referenced assemblies importing" },
                                { TimerType.PredefinedTypesInit, "Predefined types initialization" },
                                { TimerType.ModuleDefinitionTotal, "Module definition" },
-                               { TimerType.UsingVerification, "Usings verification" },
+                               { TimerType.UsingResolve, "Top-level usings resolve" },
                                { TimerType.EmitTotal, "Resolving and emitting members blocks" },
                                { TimerType.CloseTypes, "Module types closed" },
                                { TimerType.Resouces, "Embedding resources" },
@@ -1057,7 +1067,7 @@ namespace Mono.CSharp {
                        };
 
                        int counter = 0;
-                       double percentage = total.ElapsedMilliseconds / 100;
+                       double percentage = (double) total.ElapsedMilliseconds / 100;
                        long subtotal = total.ElapsedMilliseconds;
                        foreach (var timer in timers) {
                                string msg = timer_names[(TimerType) counter++];