1
0
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:
Russ Cox 2009-01-06 15:39:28 -08:00
parent e286260686
commit 84953bdaa8
2 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -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
}