Commit 84953bda authored by Russ Cox's avatar Russ Cox

fix newfn

R=ken
OCL=22173
CL=22173
parent e2862606
...@@ -2078,13 +2078,14 @@ Node* ...@@ -2078,13 +2078,14 @@ Node*
newcompat(Node *n) newcompat(Node *n)
{ {
Node *r, *on; Node *r, *on;
Type *t, *t0; Type *t;
t = n->type; t = n->type;
if(t == T) if(t == T)
goto bad; goto bad;
switch(t->etype) { switch(t->etype) {
case TFUNC:
case TSTRING: case TSTRING:
case TMAP: case TMAP:
case TCHAN: case TCHAN:
......
...@@ -10,5 +10,8 @@ func main() ...@@ -10,5 +10,8 @@ func main()
{ {
f := new(()); // ERROR "new" f := new(()); // ERROR "new"
g := new((x int, f float) string); // 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
} }
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