-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
function/stdlib: ValuesFunc precise handling of marks
Previously ValuesFunc was just using the safe default behavior where if any argument contains any marked values at all then the result is automatically given the same marks. That's overly conservative though, because it means that an unmarked map with a single marked element value will become a wholly-marked list result, rather than an unmarked list with one marked element value. Now we'll opt in to custom mark handling within the function itself, and handle shallowly the marking of the overall collection -- propagating it to the result -- while letting the values inside retain their individual markings as needed. We were previously lacking unit tests for the values function, I think because it's a pretty old one from when cty was new, so this also includes additional test cases that are not directly related to marked values but cover the other interesting cases that this function must deal with, either directly (with its own code) or indirectly (by calling cty operation functions that handle it automatically).
- Loading branch information
1 parent
78acef5
commit 9a2d67f
Showing
2 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters