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.
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
}
// 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;
}
}
- 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;
type KeyType interface {
Hash() uint32
- Match(other *KeyType) bool
+ Match(other KeyType) bool
}
type Entry struct {
- key *KeyType
- value *ValueType
+ key KeyType
+ value ValueType
}
}
-func (m *HashMap) Probe (key *KeyType) *Entry {
+func (m *HashMap) Probe (key KeyType) *Entry {
ASSERT(key != nil)
var i uint32 = key.Hash() % m.capacity()
}
-func (m *HashMap) Lookup (key *KeyType, insert bool) *Entry {
+func (m *HashMap) Lookup (key KeyType, insert bool) *Entry {
// Find a matching entry.
var p *Entry = m.Probe(key)
if p.key != nil {
}
-func (n *Number) Match(other *KeyType) bool {
+func (n *Number) Match(other KeyType) bool {
// var y *Number = other
// return n.x == y.x
return false