C#: Handle Nullable<T> default parameter values in assemblies

This commit is contained in:
Tom Hvitved
2021-10-15 14:23:18 +02:00
parent 86b1305e35
commit 888a1b38aa
5 changed files with 34 additions and 9 deletions

View File

@@ -426,6 +426,16 @@ namespace Semmle.Extraction
ReportError(new InternalError(symbol, msg));
}
/// <summary>
/// Signal an error in the program model.
/// </summary>
/// <param name="loc">The location of the error.</param>
/// <param name="msg">The error message.</param>
public void ModelError(Entities.Location loc, string msg)
{
ReportError(new InternalError(loc.ReportingLocation, msg));
}
/// <summary>
/// Signal an error in the program model.
/// </summary>

View File

@@ -23,6 +23,13 @@ namespace Semmle.Extraction
Location = node.GetLocation();
}
public InternalError(Location? loc, string msg)
{
Text = msg;
EntityText = "";
Location = loc;
}
public InternalError(string msg)
{
Text = msg;