Resolve expression value and qualifier relative to the expression result.
(vars Activation)
| 613 | |
| 614 | // Resolve expression value and qualifier relative to the expression result. |
| 615 | func (a *relativeAttribute) Resolve(vars Activation) (any, error) { |
| 616 | // First, evaluate the operand. |
| 617 | v := a.operand.Eval(vars) |
| 618 | if types.IsError(v) { |
| 619 | return nil, v.(*types.Err) |
| 620 | } |
| 621 | if types.IsUnknown(v) { |
| 622 | return v, nil |
| 623 | } |
| 624 | obj, isOpt, err := applyQualifiers(vars, v, a.qualifiers) |
| 625 | if err != nil { |
| 626 | return nil, err |
| 627 | } |
| 628 | if isOpt { |
| 629 | val := a.adapter.NativeToValue(obj) |
| 630 | if types.IsUnknown(val) { |
| 631 | return val, nil |
| 632 | } |
| 633 | return types.OptionalOf(val), nil |
| 634 | } |
| 635 | return obj, nil |
| 636 | } |
| 637 | |
| 638 | // String is an implementation of the Stringer interface method. |
| 639 | func (a *relativeAttribute) String() string { |
nothing calls this directly
no test coverage detected