exprOrType typechecks expression or type e and initializes x with the expression value or type. If allowGeneric is set, the operand type may be an uninstantiated parameterized type or function value. If an error occurred, x.mode is set to invalid.
(x *operand, e Expr, allowGeneric bool)
| 1799 | // If an error occurred, x.mode is set to invalid. |
| 1800 | // |
| 1801 | func (check *Checker) exprOrType(x *operand, e Expr, allowGeneric bool) { |
| 1802 | check.rawExpr(x, e, nil, allowGeneric) |
| 1803 | check.exclude(x, 1<<novalue) |
| 1804 | check.singleValue(x) |
| 1805 | } |
| 1806 | |
| 1807 | // exclude reports an error if x.mode is in modeset and sets x.mode to invalid. |
| 1808 | // The modeset may contain any of 1<<novalue, 1<<builtin, 1<<typexpr. |
no test coverage detected