//
public abstract class ReportPrinter
{
+ protected HashSet<ITypeDefinition> reported_missing_definitions;
+
#region Properties
public int ErrorsCount { get; protected set; }
}
}
+ //
+ // Tracks reported missing types. It needs to be session specific
+ // because we can run in probing mode
+ //
+ public bool MissingTypeReported (ITypeDefinition typeDefinition)
+ {
+ if (reported_missing_definitions == null)
+ reported_missing_definitions = new HashSet<ITypeDefinition> ();
+
+ if (reported_missing_definitions.Contains (typeDefinition))
+ return true;
+
+ reported_missing_definitions.Add (typeDefinition);
+ return false;
+ }
+
public void Reset ()
{
// HACK: Temporary hack for broken repl flow
//
// This line is useful when debugging recorded messages
//
- // Console.WriteLine ("RECORDING: {0}", msg.ToString ());
+ // Console.WriteLine ("RECORDING: {0}", msg.Text);
if (session_messages == null)
session_messages = new List<AbstractMessage> ();
error_msg |= !msg.IsWarning;
}
+ if (reported_missing_definitions != null) {
+ foreach (var missing in reported_missing_definitions)
+ dest.MissingTypeReported (missing);
+ }
+
return error_msg;
}
}
if (timers == null)
return;
- Dictionary<TimerType, string> timer_names = new Dictionary<TimerType,string> () {
+ Dictionary<TimerType, string> timer_names = new Dictionary<TimerType,string> {
{ TimerType.ParseTotal, "Parsing source files" },
{ TimerType.AssemblyBuilderSetup, "Assembly builder setup" },
{ TimerType.CreateTypeTotal, "Compiled types created" },
public override bool IsEnabled (int code, bool previous)
{
- return this.code == code ? false : previous;
+ return this.code != code && previous;
}
}
public override bool IsEnabled(int code, bool previous)
{
- return this.code == code ? true : previous;
+ return this.code == code || previous;
}
}