mirror of
https://github.com/golang/go.git
synced 2025-05-14 11:54:38 +00:00
fix new(bool) error message
R=ken OCL=21616 CL=21616
This commit is contained in:
parent
eee50ae1ac
commit
cd40cd2435
@ -2000,19 +2000,19 @@ Node*
|
|||||||
newcompat(Node *n)
|
newcompat(Node *n)
|
||||||
{
|
{
|
||||||
Node *r, *on;
|
Node *r, *on;
|
||||||
Type *t;
|
Type *t, *t0;
|
||||||
|
|
||||||
t = n->type;
|
t0 = n->type;
|
||||||
if(t == T)
|
if(t0 == T)
|
||||||
goto bad;
|
goto bad;
|
||||||
|
|
||||||
if(t->etype == TARRAY)
|
if(t0->etype == TARRAY)
|
||||||
return arrayop(n, Erv);
|
return arrayop(n, Erv);
|
||||||
|
|
||||||
if(!isptr[t->etype] || t->type == T)
|
if(!isptr[t0->etype] || t0->type == T)
|
||||||
goto bad;
|
goto bad;
|
||||||
|
|
||||||
t = t->type;
|
t = t0->type;
|
||||||
switch(t->etype) {
|
switch(t->etype) {
|
||||||
case TSTRING:
|
case TSTRING:
|
||||||
goto bad;
|
goto bad;
|
||||||
@ -2031,7 +2031,7 @@ newcompat(Node *n)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if(n->left != N)
|
if(n->left != N)
|
||||||
yyerror("cannot new(*%T, expr)", t);
|
yyerror("cannot new(%T, expr)", t0);
|
||||||
dowidth(t);
|
dowidth(t);
|
||||||
on = syslook("mal", 1);
|
on = syslook("mal", 1);
|
||||||
argtype(on, t);
|
argtype(on, t);
|
||||||
@ -2044,7 +2044,7 @@ newcompat(Node *n)
|
|||||||
return r;
|
return r;
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
yyerror("cannot new(*%T)", t);
|
yyerror("cannot new(%T)", t0);
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user