mirror of
https://github.com/golang/go
synced 2024-11-25 13:17:56 -07:00
fix newfn
R=ken OCL=22173 CL=22173
This commit is contained in:
parent
e286260686
commit
84953bdaa8
@ -2078,13 +2078,14 @@ Node*
|
||||
newcompat(Node *n)
|
||||
{
|
||||
Node *r, *on;
|
||||
Type *t, *t0;
|
||||
Type *t;
|
||||
|
||||
t = n->type;
|
||||
if(t == T)
|
||||
goto bad;
|
||||
|
||||
switch(t->etype) {
|
||||
case TFUNC:
|
||||
case TSTRING:
|
||||
case TMAP:
|
||||
case TCHAN:
|
||||
|
@ -10,5 +10,8 @@ func main()
|
||||
{
|
||||
f := new(()); // ERROR "new"
|
||||
g := new((x int, f float) string); // ERROR "new"
|
||||
h := new(()); // ok
|
||||
h := new(*()); // ok
|
||||
i := new(string); // ok
|
||||
j := new(map[int]int); // ok
|
||||
k := new(chan int); // ok
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user