1
0
mirror of https://github.com/golang/go synced 2024-09-25 13:20:13 -06:00

don't try interface/structure conversion until

last resort, because it assumes every call is a
real use of the conversion.

R=ken
OCL=19026
CL=19026
This commit is contained in:
Russ Cox 2008-11-11 15:55:32 -08:00
parent 792145723e
commit b682f924d7

View File

@ -597,13 +597,6 @@ loop:
if(isptrarray(t) && isptrdarray(l->type))
goto ret;
// interface and structure
et = isandss(n->type, l);
if(et != Inone) {
indir(n, ifaceop(n->type, l, et));
goto ret;
}
// structure literal
if(t->etype == TSTRUCT) {
indir(n, structlit(n));
@ -624,6 +617,13 @@ loop:
goto ret;
}
// interface and structure
et = isandss(n->type, l);
if(et != Inone) {
indir(n, ifaceop(n->type, l, et));
goto ret;
}
if(l->type != T)
yyerror("cannot convert %T to %T", l->type, t);
goto ret;