Partially revert "CXX-2120 handle nonexistent document fields (#984)" #1445
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A small precursor change to CXX-3234 which partially reverts #984 in advance of the upcoming v_noabi refactor, which will adopt v1's "last known element key" behavior instead.
Note
The CXX-2120 implementation is private API whose resulting (undocumented) behavior is the format of error messages, which we do not (want to) consider part of stable API compatibility requirements (although this intention is not explicitly documented by our API Versioning policy... it should really be documented in a yet-to-be-written "Compatibility Guidelines" document). Therefore, this change in behavior is not considered to be an API breaking change.
As noted by comments in prior PRs (here and here), v1 implements an alternative approach to CXX-2120 which is not prone to dangling issues caused by the internal string view. Although (hopefully) unlikely, this dangling issue can be demonstrated by the following code:
Due to this potential dangling issue (+ the
optional<T>'s impact onelement's otherwise semitrivialty), this PR reverts these changes in advance of upcoming changes as part of CXX-3234 which will adopt v1's "last known element key" behavior instead:The five
ContainsSubstring()assertions modified by this PR will be modified once more by the CXX-3234 PR. These will be the only assertion modifications made by CXX-3234: there will be no other observable change in v_noabi behavior.