Using extendDictionary
does not work well with nested namespaces.
#741
Labels
bug
Something isn't working
extendDictionary
does not work well with nested namespaces.
#741
Version
5.26.2
Describe the bug
If you extend a dictionary (
extendDictionary
) and set a value in a nested namespace, it erases that whole namespace instead of just extending the one value. Details represented by the tests below.It is unlikely you ever intend to erase values when extending a dictionary, you typically only override. So the default behavior is counter to that.
You can explicitly extend each nested namespace by hand extending, but only if you ignore the generated
extendDictionary
function that "hides" the original, and then use the original.Reproduction
Taking the test cases for this utility method and adding this test case, it fails:
You can actually do this to pass:
but this is really awkward. And is more so because the symbol
extendDictionary
is replaced in local generated code meaning you have to ignore that, and import the original version to make it work.The original tests by @osdiab were not sufficient to be clear what was intended here.
Logs
No response
Config
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: