1
0
mirror of https://github.com/golang/go synced 2024-11-12 06:40:22 -07:00
type T []int
	var a []int
	var t = T(a)

R=ken
OCL=22341
CL=22341
This commit is contained in:
Russ Cox 2009-01-08 15:01:22 -08:00
parent d54abad06f
commit 1b7881adb4
2 changed files with 9 additions and 1 deletions

View File

@ -415,6 +415,12 @@ agen(Node *n, Node *res)
fatal("agen: unknown op %N", n); fatal("agen: unknown op %N", n);
break; break;
case OCONV:
if(!eqtype(n->type, nl->type, 0))
fatal("agen: non-trivial OCONV");
agen(nl, res);
return;
case OCALLMETH: case OCALLMETH:
cgen_callmeth(n, 0); cgen_callmeth(n, 0);
cgen_aret(n, res); cgen_aret(n, res);

View File

@ -563,8 +563,10 @@ loop:
// nil conversion // nil conversion
if(eqtype(t, l->type, 0)) { if(eqtype(t, l->type, 0)) {
if(l->op != ONAME) if(l->op != ONAME) {
indir(n, l); indir(n, l);
n->type = t;
}
goto ret; goto ret;
} }