Commit e2862606 authored by Robert Griesemer's avatar Robert Griesemer

- fix parse heuristic: make(x) must accept a type for x

R=r
OCL=22171
CL=22171
parent 344b1651
......@@ -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 {
......
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