mirror of
https://github.com/golang/go
synced 2024-11-25 12:07:56 -07:00
- fix parse heuristic: make(x) must accept a type for x
R=r OCL=22171 CL=22171
This commit is contained in:
parent
344b16512c
commit
e286260686
@ -785,8 +785,8 @@ func (P *Parser) ParseCall(x0 *AST.Expr) *AST.Expr {
|
||||
if P.tok != Scanner.RPAREN {
|
||||
P.expr_lev++;
|
||||
var t *AST.Type;
|
||||
if x0.tok == Scanner.IDENT && x0.s == "new" {
|
||||
// heuristic: assume it's a new(*T, ...) call, try to parse a type
|
||||
if x0.tok == Scanner.IDENT && (x0.s == "new" || x0.s == "make") {
|
||||
// heuristic: assume it's a new(T) or make(T, ...) call, try to parse a type
|
||||
t = P.TryType();
|
||||
}
|
||||
if t != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user