I added the following test toExtensionFixture.cs :
[Test]
public void TestRecursiveCustomExtension()
{
var variables = new VariableDictionary();
variables.Add("Foo", "Bar");
variables.AddExtension("supercoolfunc", SuperCoolFunc!);
variables.Add("Var1", "#{Foo|supercoolfunc}");
variables.Add("Var2", "#{Var1}");
var result = variables.Get("Var2");
result.Should().Be("2-1-18");
}
This should work fine, but actually the test fails, and the result is #{Foo|supercoolfunc}.
The bug can be fixed by updating the EvaluationContext to pass extensions to nested contexts.
On EvaluationContext.cs line 125, change:
var context = new EvaluationContext(new Binding(), x, this);
to:
var context = new EvaluationContext(new Binding(), x, this, Extensions);
I added the following test to
ExtensionFixture.cs:This should work fine, but actually the test fails, and the result is
#{Foo|supercoolfunc}.The bug can be fixed by updating the
EvaluationContextto pass extensions to nested contexts.On EvaluationContext.cs line 125, change:
to: