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:
_ = x.T{};
_ = x.T{Y:2};
- ok1.M(); // ERROR "assignment.*T"
+ ok1.M();
bad1 := *ok; // ERROR "assignment.*T"
bad2 := ok1; // ERROR "assignment.*T"
*ok4 = ok1; // ERROR "assignment.*T"
var pi2 PI = pt
pi2.PM()
}
-
-/*
-These should not be errors anymore:
-
-bug322.dir/main.go:19: implicit assignment of unexported field 'x' of lib.T in method receiver
-bug322.dir/main.go:32: implicit assignment of unexported field 'x' of lib.T in method receiver
-*/
0x0
== bugs/
-
-=========== bugs/bug322.go
-bugs/bug322.dir/main.go:19: implicit assignment of unexported field 'x' of lib.T in method receiver
-bugs/bug322.dir/main.go:32: implicit assignment of unexported field 'x' of lib.T in method receiver
-BUG: fails incorrectly