Hello
It looks to me that DetectIdentifiers cannot handle class properties and returns them as undefined even tho the variable was registered through SetVariable.
public class TestClass
{
public string Name { get; set;}
public int Age { get; set; }
}
TestClass customer = new() { Age = 1, Name = "abc" };
// was testing different options when creating the Interpreter
Interpreter target = new Interpreter(InterpreterOptions.LateBindObject | InterpreterOptions.LambdaExpressions).Reference(typeof(TestClass)).EnableReflection();
target.SetVariable("test", customer);
IdentifiersInfo detectedIdentifiers = target.DetectIdentifiers("test.Name", DetectorOptions.IncludeChildren);
Console.WriteLine($"unknown - {string.Join(", ", detectedIdentifiers.UnknownIdentifiers)}");
Console.WriteLine(target.Eval("test.Name"));
output is
Is this a known behavior or am I missing something. I expect that DetectIdentifiers.UnknownIdentifiers would be empty.
Regards
Libor
Hello
It looks to me that DetectIdentifiers cannot handle class properties and returns them as undefined even tho the variable was registered through SetVariable.
output is
Is this a known behavior or am I missing something. I expect that DetectIdentifiers.UnknownIdentifiers would be empty.
Regards
Libor