diff options
author | Russ Cox <rsc@golang.org> | 2009-04-14 19:57:27 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-04-14 19:57:27 -0700 |
commit | e3b84434186d21adfb143104682d26b187082c61 (patch) | |
tree | 4412cba7fb2355bea59581d5a49f6bae13951557 /src | |
parent | 88d487f721fe571925407482fd296125a6f74df8 (diff) | |
download | golang-e3b84434186d21adfb143104682d26b187082c61.tar.gz |
tweak interface warning heuristic.
some day i will fix this for real.
R=ken
OCL=27468
CL=27468
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/gc/subr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index cde3b58b9..1f057744e 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -2885,7 +2885,8 @@ ifaceokT2I(Type *t0, Type *iface, Type **m) // supposed to do something better eventually // but this will catch errors while we decide the // details of the "better" solution. - if(t == t0 && t->methptr == 2) { + // only warn if iface is not interface{}. + if(t == t0 && t->methptr == 2 && iface->type != T) { yyerror("probably wanted *%T not %T", t, t); *m = iface->type; return 0; |