Check for unknowns or missing attributes.
| 598 | |
| 599 | // Check for unknowns or missing attributes. |
| 600 | absl::StatusOr<absl::optional<Value>> CheckForMarkedAttributes( |
| 601 | ExecutionFrameBase& frame, const AttributeTrail& attribute_trail) { |
| 602 | if (attribute_trail.empty()) { |
| 603 | return absl::nullopt; |
| 604 | } |
| 605 | |
| 606 | if (frame.unknown_processing_enabled() && |
| 607 | frame.attribute_utility().CheckForUnknownExact(attribute_trail)) { |
| 608 | // Check if the inferred attribute is marked. Only matches if this attribute |
| 609 | // or a parent is marked unknown (use_partial = false). |
| 610 | // Partial matches (i.e. descendant of this attribute is marked) aren't |
| 611 | // considered yet in case another operation would select an unmarked |
| 612 | // descended attribute. |
| 613 | // |
| 614 | // TODO(uncreated-issue/51): this may return a more specific attribute than the |
| 615 | // declared pattern. Follow up will truncate the returned attribute to match |
| 616 | // the pattern. |
| 617 | return frame.attribute_utility().CreateUnknownSet( |
| 618 | attribute_trail.attribute()); |
| 619 | } |
| 620 | |
| 621 | if (frame.missing_attribute_errors_enabled() && |
| 622 | frame.attribute_utility().CheckForMissingAttribute(attribute_trail)) { |
| 623 | return frame.attribute_utility().CreateMissingAttributeError( |
| 624 | attribute_trail.attribute()); |
| 625 | } |
| 626 | |
| 627 | return absl::nullopt; |
| 628 | } |
| 629 | |
| 630 | absl::StatusOr<Value> OptimizedSelectImpl::ApplySelect( |
| 631 | ExecutionFrameBase& frame, const StructValue& struct_value) const { |
no test coverage detected