matchOperandTrait returns true if the operand satisfies the trait required by the function implementation, or if the implementation does not require a trait. Non-strict functions are given the chance to handle unknown and error operands themselves.
(trait int, strict bool, operand ref.Val)
| 1010 | // |
| 1011 | // Non-strict functions are given the chance to handle unknown and error operands themselves. |
| 1012 | func matchOperandTrait(trait int, strict bool, operand ref.Val) bool { |
| 1013 | return trait == 0 || |
| 1014 | (!strict && types.IsUnknownOrError(operand)) || |
| 1015 | operand.Type().HasTrait(trait) |
| 1016 | } |
| 1017 | |
| 1018 | // evalList evaluates a list construction expression. |
| 1019 | type evalList struct { |
no test coverage detected