Commit b682f924 authored by Russ Cox's avatar Russ Cox

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
parent 79214572
...@@ -597,13 +597,6 @@ loop: ...@@ -597,13 +597,6 @@ loop:
if(isptrarray(t) && isptrdarray(l->type)) if(isptrarray(t) && isptrdarray(l->type))
goto ret; goto ret;
// interface and structure
et = isandss(n->type, l);
if(et != Inone) {
indir(n, ifaceop(n->type, l, et));
goto ret;
}
// structure literal // structure literal
if(t->etype == TSTRUCT) { if(t->etype == TSTRUCT) {
indir(n, structlit(n)); indir(n, structlit(n));
...@@ -624,6 +617,13 @@ loop: ...@@ -624,6 +617,13 @@ loop:
goto ret; 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) if(l->type != T)
yyerror("cannot convert %T to %T", l->type, t); yyerror("cannot convert %T to %T", l->type, t);
goto ret; goto ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment