1
0
mirror of https://github.com/golang/go synced 2024-09-25 03:20:13 -06: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;
}