microsoft / Power-Fx

Power Fx low-code programming language
MIT License
3.21k stars 329 forks source link

Fixes enum store when SymbolTable is replaced while setting up config #2729

Closed jas-valgotar closed 2 weeks ago

jas-valgotar commented 2 weeks ago

This PR fixes the issue where inbuilt enums are no longer part of the config if the config's symbol table is replaced after initialization.

After initializing the config if SymbolTable was replaced, we were loosing the enums attached to the previous default symbol table. This PR will adds a default symbol table(seprate from existing table) to handle that.

LucGenetier commented 2 weeks ago

✅ No public API change.

MikeStall commented 5 days ago

It turns out this is a breaking change,.

    [Fact]
    public async Task NewFunctionShowsInEnumeration()
    {
        var config = new PowerFxConfig();
        config.AddFunction(new Func1Function());            
    }

Before, config.SymbolTable.FunctionNames.ToArray() has the new function "func1". Now, it does not, and the function is at: config.InternalConfigSymbols.FunctionNames.ToArray()

This is breaking some tests in Dataverse repro trying to uptake it (see CompileBasic).