Patchwork Go patch committed: Improve error message

login
register
mail settings
Submitter Ian Taylor
Date June 27, 2013, 7:20 p.m.
Message ID <mcrhagjjr7o.fsf@iant-glaptop.roam.corp.google.com>
Download mbox | patch
Permalink /patch/255124/
State New
Headers show

Comments

Ian Taylor - June 27, 2013, 7:20 p.m.
This patch from Rémy Oudompheng improves an error message for an invalid
use of [...] in a variable declaration.  The error message said it was
in a type conversion, but it was not.  Bootstrapped and ran Go testsuite
on x86_64-unknown-linux-gnu.  Committed to mainline and 4.8 branch.

Ian

Patch

diff -r 6412862fce26 go/parse.cc
--- a/go/parse.cc	Wed Jun 26 15:57:10 2013 -0700
+++ b/go/parse.cc	Thu Jun 27 12:17:15 2013 -0700
@@ -3040,7 +3040,7 @@ 
 		  && t->array_type()->length()->is_nil_expression())
 		{
 		  error_at(ret->location(),
-			   "invalid use of %<...%> in type conversion");
+			   "use of %<[...]%> outside of array literal");
 		  ret = Expression::make_error(loc);
 		}
 	      else