gc: relax assignability of method receivers
The spec was adjusted in commit df410d6a4842 to allow the
implicit assignment of strutures with unexported fields in
method receivers. This change updates the compiler.
Also moved bug322 into fixedbugs and updated golden.out
to reflect the removal of the last known bug.
Fixes #1402.
R=golang-dev, gri, rsc
CC=golang-dev
https://golang.org/cl/4526069
diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c
index 9aaf3e6..0cf1168 100644
--- a/src/cmd/gc/typecheck.c
+++ b/src/cmd/gc/typecheck.c
@@ -822,7 +822,13 @@
case ODOTMETH:
n->op = OCALLMETH;
- typecheckaste(OCALL, n->left, 0, getthisx(t), list1(l->left), "method receiver");
+ // typecheckaste was used here but there wasn't enough
+ // information further down the call chain to know if we
+ // were testing a method receiver for unexported fields.
+ // It isn't necessary, so just do a sanity check.
+ tp = getthisx(t)->type->type;
+ if(l->left == N || !eqtype(l->left->type, tp))
+ fatal("method receiver");
break;
default: