static Hashtable warning_regions_table;
+ //
+ // This is used to save/restore the error state. When the
+ // error stack contains elements, warnings and errors are not
+ // reported to the user. This is used by the Lambda expression
+ // support to compile the code with various parameter values.
+ //
+ static Stack error_stack;
+
/// <summary>
/// List of symbols related to reported error/warning. You have to fill it before error/warning is reported.
/// </summary>
1616, 1633, 1634, 1635, 1685, 1690, 1691, 1692,
1717, 1718, 1720,
1901,
- 2002, 2023,
+ 2002, 2023, 2029,
3005, 3012, 3018, 3019, 3021, 3022, 3023, 3026, 3027,
#if GMCS_SOURCE
402, 414, 693, 1058, 1700, 3024
warning_regions_table = null;
}
+ public static void DisableErrors ()
+ {
+ if (error_stack == null)
+ error_stack = new Stack ();
+ error_stack.Push (Errors);
+ }
+
+ public static void EnableErrors ()
+ {
+ Errors = (int) error_stack.Pop ();
+ }
+
abstract class AbstractMessage {
static void Check (int code)
public virtual void Print (int code, string location, string text)
{
+ if (error_stack != null && error_stack.Count != 0)
+ return;
+
if (code < 0)
code = 8000-code;
}
public class InternalErrorException : Exception {
- public InternalErrorException (Location loc, string text, Exception e)
- : base (loc + " " + text, e)
+ public InternalErrorException (MemberCore mc, Exception e)
+ : base (mc.Location + " " + mc.GetSignatureForError (), e)
{
}