You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the DetectIdentifiers method of the Interpreter, generic type (e.g. Tuple<>) is incorrectly detected as an unknown identifier, despite being properly referenced and Eval() works.
var target = new Interpreter();
target.Reference(typeof(Tuple<>));
target.Reference(typeof(Tuple<,>));
target.Reference(typeof(Tuple<,,>));
var expression = "new Tuple<int>(1).Item1";
var result = target.Eval(expression);
Console.WriteLine(result); // 1
var detectedIdentifiers = target.DetectIdentifiers(expression);
Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(detectedIdentifiers.UnknownIdentifiers)); // ["Tuple"]
I think we can add a KnownGenericTypes, and update DetectIdentifiers
else if (_settings.KnownGenericTypes.TryGetValue(identifier, out ReferenceType knownType))
knownTypes.Add(knownType);
, but I'm not sure if there's an better fix. Could you take a look when you have time?
The text was updated successfully, but these errors were encountered:
Description
When using the DetectIdentifiers method of the Interpreter, generic type (e.g. Tuple<>) is incorrectly detected as an unknown identifier, despite being properly referenced and Eval() works.
I think we can add a KnownGenericTypes, and update
DetectIdentifiers
, but I'm not sure if there's an better fix. Could you take a look when you have time?
The text was updated successfully, but these errors were encountered: