Remove dead code; fix referencing of a type assertion in a selector expression

This commit is contained in:
gingerBill
2018-03-04 09:25:02 +00:00
parent 41b6d215bb
commit 584dffea14
6 changed files with 18 additions and 58 deletions

View File

@@ -1354,6 +1354,9 @@ 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;
}
if (expr->kind != AstNode_TypeAssertion) {
return true;
}