Commit 83a79851 authored by Ken Thompson's avatar Ken Thompson

more on t,ok = I.(T)

R=r
OCL=18599
CL=18599
parent 48d111f0
...@@ -469,6 +469,7 @@ loop: ...@@ -469,6 +469,7 @@ loop:
case OCONV: case OCONV:
if(cl == 2 && cr == 1) { if(cl == 2 && cr == 1) {
// a,b = i.(T) // a,b = i.(T)
walktype(r->left, Erv);
if(r->left == N) if(r->left == N)
break; break;
et = isandss(r->type, r->left); et = isandss(r->type, r->left);
...@@ -2964,6 +2965,20 @@ multi: ...@@ -2964,6 +2965,20 @@ multi:
n = list(n, a); n = list(n, a);
break; break;
case OCONV:
// a,b := i.(T)
if(cl != 2)
goto badt;
walktype(nr->left, Erv);
if(!isinter(nr->left->type))
goto badt;
// a,b = iface
a = old2new(nl->left, nr->type);
n = a;
a = old2new(nl->right, types[TBOOL]);
n = list(n, a);
break;
case ORECV: case ORECV:
if(cl != 2) if(cl != 2)
goto badt; goto badt;
...@@ -2975,6 +2990,7 @@ multi: ...@@ -2975,6 +2990,7 @@ multi:
n = a; n = a;
a = old2new(nl->right, types[TBOOL]); a = old2new(nl->right, types[TBOOL]);
n = list(n, a); n = list(n, a);
break;
} }
n = rev(n); n = rev(n);
return n; return n;
......
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