Message ID | mcr8us43blb.fsf@iant-glaptop.roam.corp.google.com |
---|---|
State | New |
Headers | show |
diff -r d43179a88410 go/expressions.cc --- a/go/expressions.cc Mon Mar 17 21:25:04 2014 -0700 +++ b/go/expressions.cc Thu Mar 20 11:49:49 2014 -0700 @@ -12993,6 +12993,20 @@ { // The type may not be resolvable at this point. Type* type = this->type_; + + for (int depth = this->depth_; depth > 0; --depth) + { + if (type->array_type() != NULL) + type = type->array_type()->element_type(); + else if (type->map_type() != NULL) + type = type->map_type()->val_type(); + else + { + // This error will be reported during lowering. + return TRAVERSE_CONTINUE; + } + } + while (true) { if (type->classification() == Type::TYPE_NAMED)