Message ID | mcrlhr31vhg.fsf@iant-glaptop.roam.corp.google.com |
---|---|
State | New |
Headers | show |
diff -r d7e00d7c498b go/parse.cc --- a/go/parse.cc Mon Aug 04 19:56:11 2014 -0700 +++ b/go/parse.cc Mon Aug 04 19:58:30 2014 -0700 @@ -2870,7 +2870,10 @@ // For a function literal, the next token must be a '{'. If we // don't see that, then we may have a type expression. if (!this->peek_token()->is_op(OPERATOR_LCURLY)) - return Expression::make_type(type, location); + { + hold_enclosing_vars.swap(this->enclosing_vars_); + return Expression::make_type(type, location); + } bool hold_is_erroneous_function = this->is_erroneous_function_; if (fntype_is_error)