diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-03-26 19:04:54 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-03-26 19:04:54 +0000 |
commit | 08b4fa8a7b43c83479339a6d7e9f5fd07553b302 (patch) | |
tree | 56264158b207937d6617bfe8b90821378c76b6a2 /gcc/go | |
parent | cb83a137db640e7af9ce13ea9d42b2f90f0442cd (diff) | |
download | gcc-08b4fa8a7b43c83479339a6d7e9f5fd07553b302.zip gcc-08b4fa8a7b43c83479339a6d7e9f5fd07553b302.tar.gz gcc-08b4fa8a7b43c83479339a6d7e9f5fd07553b302.tar.bz2 |
Don't look up methods for pointer to interface.
From-SVN: r171562
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/gofrontend/types.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 6ca22cb..6feb035 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -7995,7 +7995,7 @@ Type::bind_field_or_method(Gogo* gogo, const Type* type, Expression* expr, const Named_type* nt = type->deref()->named_type(); const Struct_type* st = type->deref()->struct_type(); - const Interface_type* it = type->deref()->interface_type(); + const Interface_type* it = type->interface_type(); // If this is a pointer to a pointer, then it is possible that the // pointed-to type has methods. @@ -8011,7 +8011,6 @@ Type::bind_field_or_method(Gogo* gogo, const Type* type, Expression* expr, return Expression::make_error(location); nt = type->points_to()->named_type(); st = type->points_to()->struct_type(); - it = type->points_to()->interface_type(); } bool receiver_can_be_pointer = (expr->type()->points_to() != NULL @@ -8164,7 +8163,7 @@ Type::find_field_or_method(const Type* type, } // Interface types can have methods. - const Interface_type* it = type->deref()->interface_type(); + const Interface_type* it = type->interface_type(); if (it != NULL && it->find_method(name) != NULL) { *is_method = true; @@ -8326,12 +8325,12 @@ Type::is_unexported_field_or_method(Gogo* gogo, const Type* type, } } - type = type->deref(); - const Interface_type* it = type->interface_type(); if (it != NULL && it->is_unexported_method(gogo, name)) return true; + type = type->deref(); + const Struct_type* st = type->struct_type(); if (st != NULL && st->is_unexported_local_field(gogo, name)) return true; |