RESOLVE overwrites values #1107
Labels
CC.resolved
Issue with CureCode status built, tested or complete
Datatype: object!
Test.written
Type.bug
Submitted by: Carl
RESOLVE is used to import external references that are undefined in a specific context. However, it overwrites all values in the target context.
In the example below, 'a has a value and should not be reset to 10 by RESOLVE. ('b has no value, so it is ok to set it to 20.)
Imported from: CureCode [ Version: alpha 70 Type: Bug Platform: All Category: Native Reproduce: Always Fixed-in:alpha 71 ]
Imported from: metaeducation#1107
Comments:
Submitted by: BrianH
If that is the definition of RESOLVE, this is big news. Code has already been written with the old definition in mind. We will have to go over all code that uses RESOLVE to see if the overwriting was intentional on a case-by-case basis.
We might need an /all option to force the overwriting behavior. Created ticket #1108 for this.
Submitted by: BrianH
While you are rewriting RESOLVE, don't forget #1095.
Submitted by: Carl
This bug was discovered during the process of separating the system and user contexts.
When separated, definitions for all system (exported) values must be imported (resolved) into the user context. This has now been added to LOAD (although we can debate the best place to put it.) However, my tests failed immediately! It was due to RESOLVE wiping the user context on the evaluation of the second test file.
It was a one line change to fix RESOLVE. All tests pass.
Submitted by: BrianH
This change will likely prevent the proposed change to MAKE object! to make it work like OBJECT (probably a good thing).
The text was updated successfully, but these errors were encountered: