Add unselector_expr

This commit is contained in:
gingerBill
2018-03-04 11:06:59 +00:00
parent 584dffea14
commit 105de7705a
6 changed files with 23 additions and 22 deletions

View File

@@ -1353,10 +1353,7 @@ void check_is_expressible(Checker *c, Operand *o, Type *type) {
bool check_is_not_addressable(Checker *c, Operand *o) {
if (o->mode == Addressing_OptionalOk) {
AstNode *expr = unparen_expr(o->expr);
while (expr->kind == AstNode_SelectorExpr) {
expr = expr->SelectorExpr.selector;
}
AstNode *expr = unselector_expr(o->expr);
if (expr->kind != AstNode_TypeAssertion) {
return true;
}