Go patch committed: Improve error message

Submitted by Ian Taylor on June 27, 2013, 7:20 p.m.

Details

Message ID mcrhagjjr7o.fsf@iant-glaptop.roam.corp.google.com
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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