diff options
author | Russ Cox <rsc@golang.org> | 2008-11-11 15:55:32 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2008-11-11 15:55:32 -0800 |
commit | ca38a24d87d119b70ad2d531ddfc12add31c39b7 (patch) | |
tree | f4360b1b7868c25c75fb3924af022f3e6f55f7a3 /src | |
parent | 7b11e44b61f6237d4abceac8d14c5315755dc487 (diff) | |
download | golang-ca38a24d87d119b70ad2d531ddfc12add31c39b7.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/gc/walk.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index 13ad69a65..e68833c42 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -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; |