Reworked diagnostics, saves line positions in memory, instead of calculating later.
This commit is contained in:
@@ -107,11 +107,9 @@ namespace Upsilon.BaseTypes.ScriptFunction
|
||||
// if we haven't found a method, we throw an exception
|
||||
if (method == null)
|
||||
{
|
||||
var (i, pos) = diagnostics.ScriptString.GetLinePosition(span.Start);
|
||||
var line = diagnostics.ScriptString.GetLine(i);
|
||||
throw new ScriptRuntimeException(
|
||||
$"Can't find method {_method.Name} with parameter types {string.Join(", ", convertedTypes.Select(x => x.Name))} on type {_object.GetType().Name}",
|
||||
i, pos, line);
|
||||
span, diagnostics.ScriptString.GetSpan(span));
|
||||
}
|
||||
// get the method parameters
|
||||
var parameters = method.GetParameters();
|
||||
|
||||
Reference in New Issue
Block a user