mirror of https://github.com/golang/go.git
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