1
0
mirror of https://github.com/golang/go synced 2024-11-12 07:40:23 -07:00

reject struct to interface conversion for now

R=ken
OCL=21007
CL=21007
This commit is contained in:
Russ Cox 2008-12-11 15:56:13 -08:00
parent 9ba97ca308
commit 73653841af

View 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;
}