]> Cypherpunks repositories - gostls13.git/commitdiff
reject struct to interface conversion for now
authorRuss Cox <rsc@golang.org>
Thu, 11 Dec 2008 23:56:13 +0000 (15:56 -0800)
committerRuss Cox <rsc@golang.org>
Thu, 11 Dec 2008 23:56:13 +0000 (15:56 -0800)
R=ken
OCL=21007
CL=21007

src/cmd/gc/walk.c

index d31b1269a275449058a7b236fc8fb5eea3e42def..c0b78d69df1ad2ffc3c18213f0133b76acb10aa9 100644 (file)
@@ -2733,7 +2733,12 @@ isandss(Type *lt, Node *r)
                                return I2I;
                        return Inone;
                }
-               if(isnilinter(lt) || ismethod(rt) != T)
+               if(isnilinter(lt)) {
+                       if(!issimple[rt->etype] && !isptr[rt->etype])
+                               yyerror("using %T as interface is unimplemented", rt);
+                       return T2I;
+               }
+               if(ismethod(rt) != T)
                        return T2I;
                return Inone;
        }