]> Cypherpunks repositories - gostls13.git/commitdiff
tweak interface warning heuristic.
authorRuss Cox <rsc@golang.org>
Wed, 15 Apr 2009 02:57:27 +0000 (19:57 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 15 Apr 2009 02:57:27 +0000 (19:57 -0700)
some day i will fix this for real.

R=ken
OCL=27468
CL=27468

src/cmd/gc/subr.c

index cde3b58b9da0c3ab970b9996da5f17581f86e2cd..1f057744ecf8449ec4bf89d920d4fe3334a45e23 100644 (file)
@@ -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;